Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
The MongoDB library allows the Grassroots Server to use the functionality provided by MongoDB. The library uses the C language driver.
To build this service, you need the grassroots core and grassroots build config installed and configured.
The files to build the MongoDB library are in the build/<platform>
directory.
Enter the build directory
and create a user.prefs file.
You will need to edit this file to configure where the MongoDB library dependencies are stored. The file content is similar to the following
Adjust the MONGODB_HOME
and BSON_HOME
variables to where you have the mongo-c-driver installed. You can then build the handler by typing
and then
to install the library into the Grassroots system where it will be available on the server application after it has been restarted.
One of the facilities that Grassroots system provides is an API to access a MongoDB instance through JSON-based messages. All of the MongoDB messages are accessed using a mongodb key.
The client would send a child insert key with a list of child key-value pairs. These can be in a single object if you just want to insert a single document or as an array if you want to insert multiple documents. For example, both of the following requests are valid:
The response from the Server will be a list of success values along with the document ids in the same order as they were specified in the incoming request
To delete documents from a collection, a Client would send a list of the queries that would specify which documents to remove.
Documents that were previously added can be subsequently updated.