当前位置: 首页>>代码示例>>C#>>正文


C# CollectionNamespace类代码示例

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


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


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