skip to Main Content

Mongodb filter by categories

I have Product collection. In this collection each document has same keys and different values. Several documents are shown in the example below. [ { "productCategory": "Electronics", "price": "20", "priceCondition": "Fixed", "adCategory": "Sale", "productCondition": "New", "addDescription": "Lorem Ipsum Dolor Sit…

VIEW QUESTION

Find one user then get their ranking based on their total points using MongoDB

So I got the following data: Users collection { _id: ObjectId("62a2a0422ec90fea68390aaa"), name: 'Robert Yamashita', username: 'robyama', email: '[email protected]', }, { _id: ObjectId("62a2a0452ec90fea68390aad"), name: 'Charles X', username: 'cvx', email: '[email protected]', } Points collection { userId: ObjectId("62a2a0422ec90fea68390aaa"), action: 'Liked a post', points:…

VIEW QUESTION
Back To Top
Search