In my mongo collection, I have a nested variable named "instit.type". This is an array with the following elements:
db.collection.distinct("institution.type")
[
null,
[
"boarding"
],
"virtual"
]
I am trying to delete entries using the "boarding" element, however I am stuck due to being inside the array by itself (an error originally made when using $ push for the array)
I tried to find the docs:
db.collection.find({"institution.type":{ $in: ["boarding"]}}).count()
0
and
db.collection.update({"institution.id":"somenumber"}, {$pull: {"institution.type.1":"boarding"}})
"type" : [
"virtual",
[ ]
]
How to remove brackets along with the landing tag without receiving an error
JavaScript runtime error: SyntaxError: Unexpected identifier?
Any advice would be greatly appreciated and welcomed!
source
share