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:
accounts.insert({"email": "fir4tozden@gmail.com", "username": "fir4tozden", "password": "12345678", "region": "Muğla"}); /* { "_id": "RMmXZVDfQrVLQwFlquMPb98XNUCxQ6MM", "_updated": false, "_archived": false, "_created_at": 2022-03-20T00:00:00.000Z, "_created_timestamp": 1647745200000, "email": "fir4tozden@gmail.com", "username": "fir4tozden", "password": "12345678", "region": "Muğla" } */
find(params, options)
find(params, options)Find a document.
returns Object
Example:
filter(params, options)
filter(params, options)Filter documents.
Example:
has(params, options)
has(params, options)Check if they have document.
returns Boolean
Example:
update(document_id, document)
update(document_id, document)Update a document.
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