I am new to mongoDB and its Syntax.
If I am writing same query in plain SQL my query somethings like as below:
Select u.UserId,u.* from Users u where u.followersCount>u.friendsCount
Below is my sample Json structure,And I need to select (find) those userID which is having more followers than friends on itself.
I am not able to compared self elements with other elements of same collection elements.
{
"_id": ObjectId("561d6f8986a0ea57e51ec95c"),
"status": "True",
"UserId": "1489245878",
"followers": [
"1566382441",
"1155774331"
],
"followersCount": 2,
"friendsCount": 5,
"friends": [
"1135511478",
"998082481",
"565321118",
"848123988",
"343334562"
]
}