New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem: Some users need more help with using MongoDB to do queries #2315
Comments
I created a simple script some time ago with basic search in MongoDB. Here is the link to the script: We also faced an issue querying BigchainDB when it finds more than 490 records with metadata search, so we decided to use querying in MongoDB as well, as you can implement pagination with it. Here is a code example: collection.find({ $text: { $search: ' "01/2016" ' } } ).skip(100).limit(10)
.toArray(function(err, docs) {
assert.equal(err, null);
console.log("Found the following records");
docs.forEach((doc, i) => {
totalKwh += parseFloat(doc.data)
count++
})
console.log(docs.length, count,totalKwh)
client.close();
}) I can elaborate this with more explanations and examples if needed. |
Here are a couple of things I had in mind while proposing this,
The overall idea is to make the MongoDB database schema and set up more transparent to the users. |
See also issue #1816 |
Maybe also mention: There are tools that let you query a MongoDB database using SQL, e.g. |
Also link to the BigchainDB Blog post with the examples of how to query BigchainDB data using the Mongo Shell and MongoDB Compass. That post hasn't been published yet but I hope to get it published in the next week. |
We've gotten some feedback about the page about Querying in BigchainDB.
Ideas for Improvements
Provide some help with connecting to the MongoDB database, for some common setups.
Provide some query examples.
Maybe note that there are many apps that can help you visualize and query the MongoDB database in a user friendly way. We don't promote any particular one. Examples: MongoDB Compass, Studio 3T, Mongo Management Studio, NoSQLBooster for MongoDB, Dr. Mongo
The text was updated successfully, but these errors were encountered: