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 \'%\'