Answer the question
In order to leave comments, you need to log in
How to call stored JavaScript through .NET?
I need to select items from a collection using multiple filters (From Most Accurate to Least).
For example:
1 filter looks for items in 5 fields. It returns everything that it has found with flag 0.
If we did not find several records by 1 filter, then we try to find these records by a less accurate match (by 3 fields, for example). We return them with the -1 flag. Etc.
I would like to implement this with a stored function on the Mongi side and pull it from .NETa once.
I can call the storage only from the robomongi shell. From .NET, this cannot be done.
var cmd = new JsonCommand<BsonDocument>("{ eval: \"GetData()\" }");
var result = collection.Database.RunCommand(cmd);
var result = db.getCollection('mydata').find({
'prop1': 'FOO',
'prop2': '123',
});
return result;
Answer the question
In order to leave comments, you need to log in
Connect ElasticSearch better. You will make a request to it, get IDs of mongo documents - pick up documents by id. As an option.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question