无法在 MongoDb.Driver 中获取查询类 [英] Unable to get Query class in MongoDb.Driver

查看:34
本文介绍了无法在 MongoDb.Driver 中获取查询类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我指的是这篇文章查找特定元素来自 C# 的 MongoDB 文档从 MongoDB 中的特定文档中获取 Element 值.但无法在我的 Project.Project 中找到 Nuget MongoDB.Driver.Builders.Update 是 Class project.So Query class 无法识别.我已经安装了 MongoDB.Driver - 2.4.0 Ver, MongoDB.Bson &MOngoDb.Driver.Core Nugets

I am referring this post Find an specific element in a MongoDB document from C# to fetch the Element value from a specific document in MongoDB. But unable to find the Nuget MongoDB.Driver.Builders.Update in my Project.Project is of type Class project.So Query class not recognized. I have installed the MongoDB.Driver - 2.4.0 Ver, MongoDB.Bson & MOngoDb.Driver.Core Nugets

推荐答案

为什么不使用最新的驱动程序并使用 linq?Query 对象在最新的驱动程序中不可用.你指的那个帖子很老了.

Why not use the latest driver and use linq? The Query object isn't available in the latest driver. The post you are referring to is quite old.

请参阅此答案,其中解释了如何使用 Find(无论是否使用 Builder).

See this answer which explains how to use Find, with and without Builders.

MongoDB 在 C# 中的查找

这篇关于无法在 MongoDb.Driver 中获取查询类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆