• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CollectionNamespace类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CollectionNamespace的典型用法代码示例。如果您正苦于以下问题:C# CollectionNamespace类的具体用法?C# CollectionNamespace怎么用?C# CollectionNamespace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CollectionNamespace类属于命名空间,在下文中一共展示了CollectionNamespace类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: QueryMessage

 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="QueryMessage"/> class.
 /// </summary>
 /// <param name="requestId">The request identifier.</param>
 /// <param name="collectionNamespace">The collection namespace.</param>
 /// <param name="query">The query.</param>
 /// <param name="fields">The fields.</param>
 /// <param name="queryValidator">The query validator.</param>
 /// <param name="skip">The number of documents to skip.</param>
 /// <param name="batchSize">The size of a batch.</param>
 /// <param name="slaveOk">if set to <c>true</c> it is OK if the server is not the primary.</param>
 /// <param name="partialOk">if set to <c>true</c> the server is allowed to return partial results if any shards are unavailable.</param>
 /// <param name="noCursorTimeout">if set to <c>true</c> the server should not timeout the cursor.</param>
 /// <param name="oplogReplay">if set to <c>true</c> the OplogReplay bit will be set.</param>
 /// <param name="tailableCursor">if set to <c>true</c> the query should return a tailable cursor.</param>
 /// <param name="awaitData">if set to <c>true</c> the server should await data (used with tailable cursors).</param>
 /// <param name="shouldBeSent">A delegate that determines whether this message should be sent.</param>
 public QueryMessage(
     int requestId,
     CollectionNamespace collectionNamespace,
     BsonDocument query,
     BsonDocument fields,
     IElementNameValidator queryValidator,
     int skip,
     int batchSize,
     bool slaveOk,
     bool partialOk,
     bool noCursorTimeout,
     bool oplogReplay,
     bool tailableCursor,
     bool awaitData,
     Func<bool> shouldBeSent = null)
     : base(requestId, shouldBeSent)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, nameof(collectionNamespace));
     _query = Ensure.IsNotNull(query, nameof(query));
     _fields = fields; // can be null
     _queryValidator = Ensure.IsNotNull(queryValidator, nameof(queryValidator));
     _skip = Ensure.IsGreaterThanOrEqualToZero(skip, nameof(skip));
     _batchSize = batchSize; // can be negative
     _slaveOk = slaveOk;
     _partialOk = partialOk;
     _noCursorTimeout = noCursorTimeout;
     _oplogReplay = oplogReplay;
     _tailableCursor = tailableCursor;
     _awaitData = awaitData;
 }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:48,代码来源:QueryMessage.cs


示例2: AggregateFluentBucketTests

 // static constructor
 static AggregateFluentBucketTests()
 {
     var databaseNamespace = DriverTestConfiguration.DatabaseNamespace;
     __database = DriverTestConfiguration.Client.GetDatabase(databaseNamespace.DatabaseName);
     __collectionNamespace = DriverTestConfiguration.CollectionNamespace;
     __ensureTestData = new Lazy<bool>(CreateTestData);
 }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:8,代码来源:AggregateFluentBucketTests.cs


示例3: Setup

 public void Setup()
 {
     _collectionNamespace = new CollectionNamespace("foo", "bar");
     _fieldName = "a.b";
     _messageEncoderSettings = new MessageEncoderSettings();
     _valueSerializer = new Int32Serializer();
 }
开发者ID:rmattos,项目名称:mongo-csharp-driver,代码行数:7,代码来源:DistinctOperationTests.cs


示例4: BulkDeleteOperationEmulator

 // constructors
 public BulkDeleteOperationEmulator(
     CollectionNamespace collectionNamespace,
     IEnumerable<DeleteRequest> requests,
     MessageEncoderSettings messageEncoderSettings)
     : base(collectionNamespace, requests, messageEncoderSettings)
 {
 }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:8,代码来源:BulkDeleteOperationEmulator.cs


示例5: BulkUpdateOperation

 // constructors
 public BulkUpdateOperation(
     CollectionNamespace collectionNamespace,
     IEnumerable<UpdateRequest> requests,
     MessageEncoderSettings messageEncoderSettings)
     : base(collectionNamespace, requests, messageEncoderSettings)
 {
 }
开发者ID:rmattos,项目名称:mongo-csharp-driver,代码行数:8,代码来源:BulkUpdateOperation.cs


示例6: DriverTestConfiguration

        // static constructor
        static DriverTestConfiguration()
        {
            var connectionString = CoreTestConfiguration.ConnectionString.ToString();

            var mongoUrl = new MongoUrl(connectionString);
            var clientSettings = MongoClientSettings.FromUrl(mongoUrl);
            if (!clientSettings.WriteConcern.IsAcknowledged)
            {
                clientSettings.WriteConcern = WriteConcern.Acknowledged; // ensure WriteConcern is enabled regardless of what the URL says
            }

            var serverSelectionTimeoutString = Environment.GetEnvironmentVariable("MONGO_SERVER_SELECTION_TIMEOUT_MS");
            if (serverSelectionTimeoutString == null)
            {
                serverSelectionTimeoutString = "10000";
            }
            clientSettings.ServerSelectionTimeout = TimeSpan.FromMilliseconds(int.Parse(serverSelectionTimeoutString));
            clientSettings.ClusterConfigurator = cb =>
            {
                var traceSource = new TraceSource("mongodb-tests", SourceLevels.Information);
                traceSource.Listeners.Clear(); // remove the default listener
                var listener = new ConsoleTraceListener();
                traceSource.Listeners.Add(listener);
                cb.TraceWith(traceSource);
            };

            __client = new MongoClient(clientSettings);
            __databaseNamespace = mongoUrl.DatabaseName == null ? CoreTestConfiguration.DatabaseNamespace : new DatabaseNamespace(mongoUrl.DatabaseName);
            __collectionNamespace = new CollectionNamespace(__databaseNamespace, "testcollection");
        }
开发者ID:stefanocastriotta,项目名称:mongo-csharp-driver,代码行数:31,代码来源:DriverTestConfiguration.cs


示例7: MapReduceOperationBase

 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="MapReduceOperationBase"/> class.
 /// </summary>
 /// <param name="collectionNamespace">The collection namespace.</param>
 /// <param name="mapFunction">The map function.</param>
 /// <param name="reduceFunction">The reduce function.</param>
 /// <param name="messageEncoderSettings">The message encoder settings.</param>
 protected MapReduceOperationBase(CollectionNamespace collectionNamespace, BsonJavaScript mapFunction, BsonJavaScript reduceFunction, MessageEncoderSettings messageEncoderSettings)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, nameof(collectionNamespace));
     _mapFunction = Ensure.IsNotNull(mapFunction, nameof(mapFunction));
     _reduceFunction = Ensure.IsNotNull(reduceFunction, nameof(reduceFunction));
     _messageEncoderSettings = Ensure.IsNotNull(messageEncoderSettings, nameof(messageEncoderSettings));
 }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:15,代码来源:MapReduceOperationBase.cs


示例8: MapReduceOperationBase

 // constructors
 protected MapReduceOperationBase(CollectionNamespace collectionNamespace, BsonJavaScript mapFunction, BsonJavaScript reduceFunction, BsonDocument query, MessageEncoderSettings messageEncoderSettings)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
     _mapFunction = Ensure.IsNotNull(mapFunction, "mapFunction");
     _reduceFunction = Ensure.IsNotNull(reduceFunction, "reduceFunction");
     _query = query;
     _messageEncoderSettings = messageEncoderSettings;
 }
开发者ID:bollinim,项目名称:mongo-csharp-driver,代码行数:9,代码来源:MapReduceOperationBase.cs


示例9: TestFixtureSetUp

        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();

            // override this database and collection using special ones for this...
            _databaseNamespace = new DatabaseNamespace("DatabaseExistsOperationTests");
            _collectionNamespace = new CollectionNamespace(_databaseNamespace, "DatabaseExistsOperationTests");
        }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:8,代码来源:DatabaseExistsOperationTests.cs


示例10: BulkUnmixedWriteOperationEmulatorBase

 // constructors
 protected BulkUnmixedWriteOperationEmulatorBase(
     CollectionNamespace collectionNamespace,
     IEnumerable<WriteRequest> requests,
     MessageEncoderSettings messageEncoderSettings)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, nameof(collectionNamespace));
     _requests = Ensure.IsNotNull(requests, nameof(requests));
     _messageEncoderSettings = messageEncoderSettings;
 }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:10,代码来源:BulkUnmixedWriteOperationEmulatorBase.cs


示例11: AggregateOperationBase

 // constructors
 protected AggregateOperationBase(
     CollectionNamespace collectionNamespace,
     IEnumerable<BsonDocument> pipeline,
     MessageEncoderSettings messageEncoderSettings)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
     _pipeline = Ensure.IsNotNull(pipeline, "pipeline").ToList();
     _messageEncoderSettings = messageEncoderSettings;
 }
开发者ID:bollinim,项目名称:mongo-csharp-driver,代码行数:10,代码来源:AggregateOperationBase.cs


示例12: UpdateOpcodeOperationEmulator

 // constructors
 public UpdateOpcodeOperationEmulator(
     CollectionNamespace collectionNamespace,
     UpdateRequest request,
     MessageEncoderSettings messageEncoderSettings)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
     _request = Ensure.IsNotNull(request, "request");
     _messageEncoderSettings = Ensure.IsNotNull(messageEncoderSettings, "messageEncoderSettings");
 }
开发者ID:kay-kim,项目名称:mongo-csharp-driver,代码行数:10,代码来源:UpdateOpcodeOperationEmulator.cs


示例13: DeleteOpcodeOperationEmulator

 // constructors
 public DeleteOpcodeOperationEmulator(
     CollectionNamespace collectionNamespace,
     BsonDocument criteria,
     MessageEncoderSettings messageEncoderSettings)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
     _criteria = Ensure.IsNotNull(criteria, "criteria");
     _messageEncoderSettings = messageEncoderSettings;
 }
开发者ID:rmattos,项目名称:mongo-csharp-driver,代码行数:10,代码来源:DeleteOpcodeOperationEmulator.cs


示例14: UpdateOpcodeOperationEmulator

 // constructors
 public UpdateOpcodeOperationEmulator(
     CollectionNamespace collectionNamespace,
     UpdateRequest request,
     MessageEncoderSettings messageEncoderSettings)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, nameof(collectionNamespace));
     _request = Ensure.IsNotNull(request, nameof(request));
     _messageEncoderSettings = Ensure.IsNotNull(messageEncoderSettings, nameof(messageEncoderSettings));
 }
开发者ID:RainsSoft,项目名称:mongo-csharp-driver,代码行数:10,代码来源:UpdateOpcodeOperationEmulator.cs


示例15: GetMoreMessage

 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="GetMoreMessage"/> class.
 /// </summary>
 /// <param name="requestId">The request identifier.</param>
 /// <param name="collectionNamespace">The collection namespace.</param>
 /// <param name="cursorId">The cursor identifier.</param>
 /// <param name="batchSize">The size of a batch.</param>
 public GetMoreMessage(
     int requestId,
     CollectionNamespace collectionNamespace,
     long cursorId,
     int batchSize)
     : base(requestId)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
     _cursorId = cursorId;
     _batchSize = Ensure.IsGreaterThanOrEqualToZero(batchSize, "batchSize");
 }
开发者ID:fir3pho3nixx,项目名称:mongo-csharp-driver,代码行数:19,代码来源:GetMoreMessage.cs


示例16: UpdateOpcodeOperationEmulator

 // constructors
 public UpdateOpcodeOperationEmulator(
     CollectionNamespace collectionNamespace,
     BsonDocument query,
     BsonDocument update,
     MessageEncoderSettings messageEncoderSettings)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
     _criteria = Ensure.IsNotNull(query, "criteria");
     _update = Ensure.IsNotNull(update, "update");
     _messageEncoderSettings = messageEncoderSettings;
 }
开发者ID:rmattos,项目名称:mongo-csharp-driver,代码行数:12,代码来源:UpdateOpcodeOperationEmulator.cs


示例17: DeleteWireProtocol

 // constructors
 public DeleteWireProtocol(
     CollectionNamespace collectionNamespace,
     BsonDocument query,
     bool isMulti,
     MessageEncoderSettings messageEncoderSettings,
     WriteConcern writeConcern)
     : base(collectionNamespace, messageEncoderSettings, writeConcern)
 {
     _query = Ensure.IsNotNull(query, "query");
     _isMulti = isMulti;
 }
开发者ID:kay-kim,项目名称:mongo-csharp-driver,代码行数:12,代码来源:DeleteWireProtocol.cs


示例18: DeleteMessage

 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="DeleteMessage"/> class.
 /// </summary>
 /// <param name="requestId">The request identifier.</param>
 /// <param name="collectionNamespace">The collection namespace.</param>
 /// <param name="query">The query.</param>
 /// <param name="isMulti">if set to <c>true</c> [is multi].</param>
 public DeleteMessage(
     int requestId,
     CollectionNamespace collectionNamespace,
     BsonDocument query,
     bool isMulti)
     : base(requestId)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
     _query = Ensure.IsNotNull(query, "query");
     _isMulti = isMulti;
 }
开发者ID:kay-kim,项目名称:mongo-csharp-driver,代码行数:19,代码来源:DeleteMessage.cs


示例19: CollectionNamespace_should_get_value

        public void CollectionNamespace_should_get_value(
            [Values("a", "b")]
            string collectionName)
        {
            var collectionNamespace = new CollectionNamespace(_collectionNamespace.DatabaseNamespace, collectionName);
            var subject = new FakeMapReduceOperation(collectionNamespace, _mapFunction, _reduceFunction, _messageEncoderSettings);

            var result = subject.CollectionNamespace;

            result.Should().BeSameAs(collectionNamespace);
        }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:11,代码来源:MapReduceOperationBaseTests.cs


示例20: CollectionNamespace_get_should_return_expected_result

        public void CollectionNamespace_get_should_return_expected_result(
            [Values("a", "b")]
            string collectionName)
        {
            var databaseNamespace = new DatabaseNamespace("test");
            var collectionNamespace = new CollectionNamespace(databaseNamespace, collectionName);
            var subject = new FindOpcodeOperation<BsonDocument>(collectionNamespace, BsonDocumentSerializer.Instance, _messageEncoderSettings);

            var result = subject.CollectionNamespace;

            result.Should().Be(collectionNamespace);
        }
开发者ID:RainsSoft,项目名称:mongo-csharp-driver,代码行数:12,代码来源:FindOpcodeOperationTests.cs



注:本文中的CollectionNamespace类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CollectionView类代码示例发布时间:2022-05-24
下一篇:
C# CollectionItemsChangedEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap