Search code examples
mongodb-.net-driveraws-documentdb

Getting "Command find failed: Feature not supported" in .NET from AWS DocumentDb


I am calling myCollection.Find(_ => true) in C# and getting this exception. What can be wrong? What's not supported? db.MyDocs.find() in mongosh works fine...

MongoDb.Driver 2.19.0, DocumentDb engine version 4.0.0


Solution

  • Apparently, this is what happened:

    • the .NET driver translated the 'find' method call into the following MongoDB command:{ "find" : "MyDocs", "filter" : { "$expr" : true } }
    • and DocoumentDB indeed does not support the $expr operator.

    Took quite a while to figure out...