It seems reasonable to me that an IAggregateFluent (which is composed of aggregation stages), can be converted to an IQueryable (which is also composed of aggregation stages).
Hi Josh,
This is because an aggregation pipeline can be applied to IMongoCollection i.e. a kin to collection.aggregate([]) . An aggregation pipeline however, returns an aggregated result which are not persistent in the database. With an exception being if you were to specify $out operator to write into a specified collection. You can then query this collection using IQueryable.
Note that $out stage atomically replaces an existing collection with the same name. See also $out behaviours.
for example, if I want to filter to records of a particular user, I have to append this to the end of the aggregation, as this dynamic data cannot be included in the view-defined aggregation - this resulted in a full collection scan which did not give good enough performance!)
I assumed you’re referring to MongoDB Views on v3.4. Note that views use indexes of the underlying collection see views behaviour. See also Aggregation pipeline optimisation.
If you have further questions, could you provide:
Regards,
Wan.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/5dde6ad9-e3da-409c-9888-261833594f8c%40googlegroups.com.