How can I use mongodb with linq for store large binary objects(files)?
-
01-10-2019 - |
Question
I know two most popular C# drivers for mongodb, this are mongodb-csharp and NoRM. Both of them have some problems. For example, with mongodb-csharp I can't use full functional linq and with NoRM I can't store large file in mongodb. In my project, I need to use linq with large objects (files).
Solution
You could check official 10gen's MongoDB C# driver. It doesn't support LINQ yet, but they added really nice query mechanism for GridFS.
OTHER TIPS
EDIT: I didn't read the question title, sorry. I don't think you'd want to use Linq for talking with GridFS. If so, we'd be happy for some contributions.
The linq driver to mongodb-csharp is almost done. It supports projections, conditions, ordering, skip, take, and (almost ready) it will build map-reduce queries when you use an aggregate and/or group by statements.
If you grab the latest typedcollections branch, I think you'll find it does most everything you need.
I don't think that you need to use LINQ. Using LINQ is handy but it is not necessary.
A solution is to help the teams who are developing those drivers. It is all open source so you can join those teams.