Is fluent API a mongoBooster specific feature not mongo?

jeff garrett shared this question 2 years ago
Answered

just asking about fluent API

Comments (1)

photo
1

Yes, Fluent API is a MongoBooster specific feature, not mongo shell method.

We also have Cursor.getShellScript() method return the MongoDB find shell script produced by the MongoBooster Fluent Query Builder. refer to : https://www.mongobooster.com/blog/mongobooster-33-is-out

For example:

Run the following Fluent query script in MongoBooster:


  1. db.user.where('age').gte(18).lte(65)
  2. .select('name age -_id')
  3. .sort("-age name")
  4. .limit(5)
  5. .skip(100)

.getShellScript()We got the MongoDB shell find script :


  1. db.user.find({
  2. "age" : {
  3. "$gte" : 18,
  4. "$lte" : 65
  5. }
  6. }, {
  7. "name" : 1,
  8. "age" : 1,
  9. "_id" : 0
  10. })
  11. .sort({ "age" : -1, "name" : 1 })
  12. .limit(5)
  13. .skip(100)