Create a list of document ids in the collection named 'collection'. The funny name is due to the fact we're storing document ids from the notes collection in individual documents of the collection collection. i.e. we are creating (ordered) sets of documents identified with a document name.
The motivation for collections of docs collection is so that we can group documents together form display purposes. Form example, say I'm working on a project with multiple documents. I'd like to be able to "identify/tag" them to the project so I can narrow my viewing focus to just those documents.
Read a collection from the database.
Update a collection in the database.
Delete a collection from the database.
Get all pages in the notes collection. Returns a MongoDB cursor one can iterate over.
Get all the collection ids for which this page is a member of.
Set the collection we want to work with. In this case it's the collection named 'collection'. It's a bit meta is why the funny naming.