Hi guys, Today I needed to execute a query to filter some records. Lets say I have a Product Collection(Tables are called Collection in MongoDB) and I have following two fields in my product collection for simplicity. Product ---------------- Id sku (store keeping unit) I retrieve data from collection like this. var products = models.Product.find(MongoDBObject("title" -> "atitle") ) .skip(0).limit(10).toList I have filtered data by 'title' already and I have I want 10 records from 0 by specifying skip and limit. Now I have another list ('sku' list) that is list contains sku values. I want to retrieve Product list from DB that is not in SKU list. To do this I have used $nin which is a query operator of MongoDB. var products = models.Product.find( {"sku" $nin descendents}, {MongoDBObject("title" -> "atitle")} ) .skip(offest).limit(10).toList more...
Life as a software developer