I am wanting to write some ruby to iterate through documents in a collection in a MongoDB.
My data has the schema:
"_id" : ObjectId("560ff830eeb4db07875b59b9"),
"userId" : NumberInt(1),
"movieId" : NumberInt(50),
"rating" : 4.0,
"timestamp" : NumberInt(1329753504)
I firstly want to count each time userId = 1 is present in the whole collection, and if less than 5 discard them all.
I'm really unsure how to tackle this, so any advice would be great.