Collections
A collection is a folder that has documents
Overview
Think of a collection like a folder. It holds documents. Each document needs a folder (or “collection”) to live in. When you search, you’re looking through documents in a specific collection.
A collection consists of:
- A
name
that you set during creation. It must be unique and there are some additional restrictions. documents
stored within it.
If you submit documents without specifying their collections, they will automatically be stored in a default collection named personal
.
Working with collections
Working with collections in Memora is straightforward. You can create, delete, and update them according to your needs.
Creating a collection
In Memora, you don’t need to manually create a collection. Take a look at this snippet:
The The Answer to [...]
document will be stored in the book-citations
collection — if that collection doesn’t exists, Memora will create it.
That’s how collection creation works: the first time you add something to a new collection, Memora creates that collection for you.
Collection name
Certain rules apply when naming your collection. Here’s what you can include:
Name | Example |
---|---|
English letters | abcXYZ |
Numbers | abc123XYZ |
Special characters (_, -, ., @ and :) | @abc.1:23-XYZ_ |
Searching within a collection
To find documents within a specific collection, use memora.in()
.
If you don’t specify a collection name in memora.in()
, Memora will automatically use your default collection — named personal
— for the search.
Deleting a collection
To delete a collection, use memora.delete()
passing the modifier .collection(name)
.
Please be cautious when deleting a collection. This action will also erase all documents contained within the collection.
Limits
To learn more about limits related to documents, refer to this page.