Hello, I’m trying to use $searchMeta in React using Realm, and it produces this error:
Error retrieving facets: Error: Request failed (POST https://us-west-2.aws.realm.mongodb.com/api/client/v2.0/app/xxxxx/functions/call): Location40324 Unrecognized pipeline stage name: ‘$searchMeta’ (status 500) at MongoDBRealmError.fromRequestAndResponse.
However, I do the same for other $match, $search, and other stages and it works properly.
This is the code:
const collection = await connectToMongoDB(connetionData);
const pipeline = [];
pipeline.push({
$searchMeta: {
index: “hc-appointments”,
facet: {
facets: {
stringFacet: {
type: “string”,
path: patient.display
}
}
}
}
});
const facets = await collection.aggregate(pipeline);
Does anyone know what am I doing wrong?
Thanks a lot