0

I've this sample MongoDB data:

{"FirstName": "Bruce", "LastName": "Wayne", 
"Email": "[email protected]"}
{"FirstName": "Lucius", "LastName": "Fox", 
"Email": "[email protected]"}
{"FirstName": "Dick", "LastName": "Grayson", 
"Email": "[email protected]"}

and what I'm trying to get and find the count of all documents

1 Answer 1

1

Maybe something like this:

   db.col.aggregate([  {$match:{  "Bed Grade":4}}  , {  $group: {_id:{h:"$Hospital_code" ,d:"$Department" } , cnt:{$sum:1}} }  , {$match:{cnt:{$gt:5}}}  ])
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you!, could I share another question?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.