-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.9.2
-
Component/s: API, Command Operations
-
None
I want find data where field1 (DateTime) < field2 (DateTime). This is my query:
FilterDefinition<Measurement> filter = fb.And(
fb.Eq(m => m.DataProvider, new ObjectId(dataProviderId)),
fb.Where(m => m.RcvTime < m.ObsTime));
В результате я получаю следующую ошибку
Unhandled Exception: System.ArgumentException: Unsupported filter: ({document}{RcvTime} < {document}{ObsTime}). at MongoDB.Driver.Linq.Translators.PredicateTranslator.Translate(Expression node) at MongoDB.Driver.Linq.Translators.PredicateTranslator.Translate(Expression node, IBsonSerializerRegistry serializerRegistry) at MongoDB.Driver.AndFilterDefinition`1.Render(IBsonSerializer`1 documentSerializer, IBsonSerializerRegistry serializerRegistry) at MongoDB.Driver.MongoCollectionImpl`1.CreateFindOperation[TProjection](FilterDefinition`1 filter, FindOptions`2 options) at MongoDB.Driver.MongoCollectionImpl`1.FindAsync[TProjection](IClientSessionHandle session, FilterDefinition`1 filter, FindOptions`2 options, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSessionAsync[TResult](Func`2 funcAsync, CancellationToken cancellationToken) at Csdn.TimeCheck.Program.Main(String[] args) in /home/valera/RiderProjects/Csdn.TimeCheck/Csdn.TimeCheck/Program.cs:line 30 at Csdn.TimeCheck.Program.<Main>(String[] args)