MongoDB.Driver.MongoCommandException: "Command aggregate failed: Variable $$SEARCH_META not supported yet."

SvenGlöckner 441 Reputation points
2024-08-12T12:42:13.03+00:00

Hi,

I'm trying to migrate an app from MongoDB Atlas to Azure MongoDB vCore.

We're using C# code to run an aggregation pipeline but this is failing with the error message

MongoDB.Driver.MongoCommandException: "Command aggregate failed: Variable $$SEARCH_META not supported yet."

This is the code snippet:

IEnumerable<ProductBase> result = await GetCollection<ProductBase>().Aggregate() 
                  .Project<ProductBase>(Builders<ProductBase>.Projection
                          .SearchMeta(x => x.MetaResult)


I wonder why this is failing because in the docs we see that searchMeta is supported on MongoDB in Azure.

https://video2.skills-academy.com/en-us/azure/cosmos-db/mongodb/vcore/compatibility

Can anyone help?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,612 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 18,616 Reputation points Microsoft Employee
    2024-08-14T14:19:29.29+00:00

    @SvenGlöckner Thank you for reaching out.

    Sorry for the delay in response to your question.

    Support for SearchMeta stage and variables is on our roadmap. SearchMeta is very specific to Atlas Search indexes. We will love to understand more about your scenario/queries of searchMeta so I can take that back to our product group.

    Regards,

    Oury


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.