2

Using the Mongo Stitch SDK for iOS, trying to execute a projection using $elemMatch gives a weird error that doesn't occur using the same query structure on mongo shell.

var projection: Document = [
                    MongoFieldNames.pendingRequestsSent: [
                        "$elemMatch" : [
                            Fields.firebaseUserId : User.shared.metadata.userId 
                        ] as Document
                    ] as Document
                ] 

That is how I create the query. But it gives me this error:

invalid %project specification: projection string value must start with a \'%\'
E.SK
  • 121
  • 9

0 Answers0