Simplify Go programs which use MongoDB. Create a library which supports the 10% of the calls which are needed 90% of the time, while easily allowing the use of the other 90% of MongoDB capabilities which are needed 10% of the time.
-
Support the 10% of the calls which are used 90% of the time
-
The other 90% of the calls which are used 10% of the time should be no more difficult to do then without this library
-
Calls should resemble the calls made via the MongoDB Console
-
Although error checking is important, it shouldn't get in the way of being able to chain calls such as:
db.Coll("someCollection"). Find(`{"lastName":"Johnson"}`). Sort(`{"firstName":1}`). Limit(5). Pretty()
-
Don't extend the capabilities of the MongoDB Golang driver, just simplify the use of what's there
-
New MongoDB releases should not require changes to the library or programs that use the library.
Combined with Jupyter Notebook and GopherNotes, this provides a simple interface to run MongoDB Shell like commands using Go. Not only easy to iterate and easy to rerun, but also a great way to prototype code which can then be copied and pasted into a Go program. Below is an example query in Juptyter notebook using JSON strings.
See here for a brief slide presentation on running MonGolang on Jupyter and then using the code in a standalone compiled Go program.
There is a PDF demo of the use of MonGolang in Jupyter in this repo at MonGolang_v0.2.1_Demo.pdf
There is also a PDF demo of the changes in release v0.2.2, which included support for insert and delete MongoDB Shell commands as well as a PrintBSON()
and support for extended JSON at MonGolang_v0.2.2_Demo.pdf