i have this query and it is working in MongoDB Booster, but i don't understand why i can't only copy this in Python, as i do for query on MySQL, and what should I do with this query, so it can work normally in MongoDB
Query that works in MongoDB Booster but it doesn't work when i copy in Python looks like this:
db.bol_rac.aggregate( [
{
$project:
{
"id" : 1,
"id_drz": 1,
"location" :
{
$cond: { if: { $eq: [ "$id_drzavljanstvo", 688 ] }, then: "Country", else: "Foreign country" }
}
}
}
] );