You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a collection and in each document there are a certain set of fields, but not all documents contain all fields. For example, in collection "foo" we can have three documents:
Each one is a client that bought a certain product and because of that other fields reflect the product that he bought and not every document has every single field.
If I was trying to retrieve all documents i would use:
filter = Mongoc.BSON("""{"projection": {"car_colour": true}}""")
res = Mongoc.find(foo, options=filter)
It would return an error stating: KeyError: key "car_colour" not found
I was expecting to it return all documents and in those docs that have fields that don't exists in other documents, just return empty in that field. From my experience Python does something similar with PyMongo.
Julia: 1.9.1 Mongoc: 0.9.0
edit: Added version of Julia and Mongoc
The text was updated successfully, but these errors were encountered:
I have a collection and in each document there are a certain set of fields, but not all documents contain all fields. For example, in collection "foo" we can have three documents:
Each one is a client that bought a certain product and because of that other fields reflect the product that he bought and not every document has every single field.
If I was trying to retrieve all documents i would use:
It would return an error stating:
KeyError: key "car_colour" not found
I was expecting to it return all documents and in those docs that have fields that don't exists in other documents, just return empty in that field. From my experience Python does something similar with PyMongo.
Julia: 1.9.1 Mongoc: 0.9.0
edit: Added version of Julia and Mongoc
The text was updated successfully, but these errors were encountered: