Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Displaying Cursor Information in MongoDB

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 528
    Comment on it

    As we know cursor in mongoDB can be defined as return value of query run to mongoDB. The information of can be display using cursor.explain() function as show in below:

    db.collection.find().explain()
    

    The explain() method returns a document with the query plan and, optionally, the execution statistics. The output of this command look like:

    {
        "cursor" : "BasicCursor",
        "isMultiKey" : false,
        "n" : 45,
        "nscannedObjects" : 45,
        "nscanned" : 45,
        "nscannedObjectsAllPlans" : 45,
        "nscannedAllPlans" : 45,
        "scanAndOrder" : false,
        "indexOnly" : false,
        "nYields" : 2,
        "nChunkSkips" : 0,
        "millis" : 74,
        "server" : "my-pc:27017",
        "filterSet" : false
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: