Every MongoDB database has a collection, which consists of documents. While we didn't get to the creating objects topic in our guide, to create a collection manually go to MongoHQ's web console, select a database, and click on the Add Collection button.
You can then name your new collection and click on the Create collection button as shown in the following screenshot:
Checking the collection API documentation, we will see a request path /databases/:db/collections
. The :db
in this path is a parameter, and should be equal to a database name. I prefer calling it databaseID
. Such a name reflects the true essence of a parameter as the database name is a database identifier here.
So to load our collections, we will use a path pattern, /databases/:databaseID/collections
. The mapping setup for collections looks quite similar to the database mapping:
- (void)setupCollectionMappings { RKObjectManager *manager = [RKObjectManager...