DocumentBasedCollection
Methods for document-based collections.
insert(document)
insert(document)
Insert a document.
Parameter | Description |
---|---|
document | Object The document to be written to the collection. |
returns Object
Example:
find(params, options)
find(params, options)
Find a document.
Parameter | Description |
---|---|
params | |
options | Object (optional) Find options. |
options.archived | Boolean (optional) Whether to find archived documents. |
returns Object
Example:
filter(params, options)
filter(params, options)
Filter documents.
Parameter | Description |
---|---|
params | |
options | Object (optional) Filter options. |
options.archived | Boolean (optional) Whether to filter archived documents. |
Example:
has(params, options)
has(params, options)
Check if they have document.
Parameter | Description |
---|---|
params | |
options | Object (optional) Find options. |
options.archived | Boolean (optional) Whether to has archived documents. |
returns Boolean
Example:
update(document_id, document)
update(document_id, document)
Update a document.
Parameter | Description |
---|---|
document_id | String The ID of the document to be updated. |
document | Object The document to be updated in the collection. |
returns Object
Example:
archive(document_id)
archive(document_id)
Archive a document.
Parameter | Description |
---|---|
document_id | String The ID of the document to be archived. |
returns Boolean
Example:
unarchive(document_id)
unarchive(document_id)
Unarchive a document.
Parameter | Description |
---|---|
document_id | String The ID of the document to be unarchived. |
returns Boolean
Example:
delete(document_id)
delete(document_id)
Delete a document.
Parameter | Description |
---|---|
document_id | String The ID of the document to be deleted. |
returns Boolean
Example:
Last updated