mongodb / stitch-ios-sdk

Apache License 2.0
42 stars 25 forks source link

Error thrown if trying to project exclude fields that aren't present in document #210

Open EthanSK opened 4 years ago

EthanSK commented 4 years ago

It used to be that if I have a projection myField: 0, then it would exclude myField from the document results. If myField did not exist in the document, it would just carry on normally as expected and return the document. However, recently, in my production app, it started throwing an error to do with pre-image not matching. I hadn't even updated the app, it just started happening, so it's probably not something to do with the stitch sdk making a breaking change, but mongodb itself changing? Or maybe this is a flaw in stitch that is only now being exposed due to some internal change with mongo.

mpobrien commented 4 years ago

Hi @EthanSK, Can you provide details on the full operation where the error appears? i.e. the full query and projection details, and a sample doc if possible. It's possible that this is a bug, but it might be something specific to the details of your query. If you can provide your app ID, that may be helpful as well.

EthanSK commented 4 years ago

My stitch app id is jecto-rngfg

It happens in project when trying to exclude a field that is an array of objects.

Happens when it's included with any query (non aggregation, I think the aggregation version of it works fine)