从mongodbc中读取特定的字段值# [英] Read specific field values from mongodbc#

查看:271
本文介绍了从mongodbc中读取特定的字段值#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我开始使用MongoDB。我必须使用mongodb C#driver从mongodb读取特定字段(列)。这意味着无论值是什么,我都必须读取特定字段。我只需要指定字段。



我如何实现?



我的尝试:



我使用Getcollection<>读取了Collection在C#library.then我坚持这个任务后。

Recently I started using MongoDB.I have to read specific fields(columns) from mongodb using mongodb C# driver.That means i have to read specific fields no matter whatever the values.i need to just specify the fields.

How can i achieve?

What I have tried:

I read Collection using Getcollection<> in the C# library.then after i stucked with this task.

推荐答案

项目字段从查询返回 - MongoDB手册3.4 [ ^ ]。


这篇关于从mongodbc中读取特定的字段值#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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