(1)Download the MongoDB C#驱动. ://.nuget.org/packages/mongocsharpdriver/. (2) Add Reference to C# 驱动 DLLs 1MongoDB.Bson.dll 2MongoDB.Driver.dll 3MongoDB.Driver.Core.dll 或者 Nuget 下载 VS 2012/1
转载 2018-07-23 13:41:00
67阅读
2评论
var query= db.GetCollection("merchant").Find(Query.EQ(m => m.Id, id)) .SetFields(Fields.Include(m => m.Address).Include(m => m.Name));
转载 2013-12-23 11:37:00
121阅读
2评论
var queryDetail = new BsonDocument("cNo", doc.cNo); queryDetail.AddRange(new BsonDocument("Details.dDate", doc.oRDate)); //日表数组中存在相同报表日期的数据 ...
转载 2017-04-12 10:53:00
143阅读
2评论
static async Task CreateIndex() { var client = new MongoClient(); var database = client.GetDatabase("HamsterSchool"); var collection = database.GetCollection("Hamsters"); await collect...
转载 2017-02-15 17:40:00
101阅读
2评论
C#驱动对mongodb的操作,目前驱动有两种:官方驱动和samus驱动(官方驱动比较原生态,业务扩展比较灵活;samus第三方驱动提供了丰富的linq操作,相当方便) 。官方驱动下载地址:https://github.com/mongodb/mongo-csharp-driver/downloads samus驱动下载地址:https://github.com/samus/m
原创 2013-09-01 23:32:56
1387阅读
1点赞
public async Task CollectionExistsAsync(string collectionName) { var filter = new BsonDocument("name", collectionName); //filter by collection name var collections = await ...
转载 2017-02-15 15:21:00
129阅读
2评论
#region 索引 //IndexKeysDocument doc = new IndexKeysDocument();//新建索引 //2d 平面坐标索引,适用于基于平面的坐标计算。也支持球面距离计算,不过官方推荐使用2dsphere索引 //BsonValue value = BsonValue.Create("2d");//创建2d索引 //2dsphere 几何球体索引...
转载 2017-08-02 11:20:00
84阅读
2评论
1.使用属性代替使用成员变量 2.使用readonly代替const // Compile time constant: public const int Millennium = 2000; // Runtime constant: public static readonly int ThisYear = 2004; 编译时常量在编译时,将用到该常量的地方都用它的值(200
原创 2011-06-14 23:42:00
1391阅读
1评论
前言 在日常工作中,如果涉及到与第三方进行接口对接,有的会使用WebService的方式,这篇文章主要讲解在.NET Framework中如何调用WebService。首先我们创建
转载 2023-06-06 09:16:49
499阅读
】、
原创 2022-09-02 17:16:46
596阅读
1评论
最近有在学习MongoDB,看到了关于Map-Reduce,觉得蛮有意思的,所以在这里就记录下来作为学习笔记。关于Map-Reduce的作用这里就引用一下官网以及另外一篇文章看到的,言简意赅。​The map-reduce operation is composed of many tasks, including: reads from the input collection,executio
转载 2013-08-15 18:28:00
45阅读
2评论
标题:C#速成(Quick C#) 原作者:Aisha Ikram 翻译:bigqiang 网站:http://www.fazhuan.com/ 信箱:bigqiang@sina.com --------------------------------------------------------...
转载 2021-08-05 21:48:59
1991阅读
1评论
简单学C#,分享一下共同学习,共同进步!
转载 精选 2008-11-28 16:07:01
5197阅读
1. 可空类型修饰符(?) 引用类型可以使用空引用表示一个不存在的值,而值类型通常不能表示为空。 例如:string str=null; 是正确的,int i=null; 编译器就会报错。 为了使值类型也可为空,就可以使用可空类型,即用可空类型修饰符"?"来表示,表现形式为"T?" 例如:int? 表示可空的整形,DateTime? 表示可为空的时间。 T? 其实是System.Nulla
转载 2020-05-15 09:30:00
418阅读
2评论
https://docs.microsoft.com/zh-cn/dotnet/standard/collections/thread-safe/blockingcollection-overviewBlockingCollection 概述 BlockingCollection<T> 是一个线程安 ...
转载 2021-07-19 15:35:00
188阅读
2评论
# C# > C-Sharp
转载 2020-05-24 22:02:00
208阅读
2评论
C#中$的用法:"$"是在C#6.0出现的一个新特性,其作用相当于对String.format()的简化。s
原创 2021-11-29 16:49:22
220阅读
https://docs.microsoft.com/zh-cn/ http://c.biancheng.net/view/2823.html https://www.runoob.com/csharp/csharp-tutorial.html
原创 2023-05-17 13:10:23
46阅读
1、CSC.exe的存放位置如果想要使用C# Compiler,只要在命令提示符(command prompt)中输入csc.exe就可以了。csc.exe的路径在C:\Windows\Microsoft.NET\Framework64\v4.0.30319下。(注意,我的电脑的操作系统是64位。)You can invoke the C# compiler by typing the name
原创 2016-03-21 11:04:17
1315阅读
一、概述数组为引用类型,其中的元素固定。 定义后不能增加删除元素。(如果事先不知道应包含多少元素,则应使用List集合)。数组可以包含同一类型的多个元素。数组实现了IEumerable,ICollection,IList接口的部分功能。二、声明数组变量及使用1、一维数组:[]声明及初始化: int[] arr1 = new int[5];//声明带5个元素的数组 //或者int[] arr2...
转载 2018-08-06 09:28:00
430阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5