mongodb-csharp-2.0 Questions
3
How do you call the Ping command with the new C# driver 2.0?
In the old driver it was available via Server.Ping()? Also, Is there a way to find out if the server is running/responding without runni...
Invocation asked 8/6, 2015 at 15:43
3
Solved
I need to retrieve all the documents that are in my collection in MongoDB, but I cannot figure out how. I have declared my 'collection' like this-
private static IMongoCollection<Project> Sp...
Limestone asked 26/5, 2015 at 8:47
1
Solved
I am able to update a Document if the Document Exists using the Following
var filter = Builders<Neighborhood>.Filter.Eq(x => x.Id, neighborhood.Id);
var result = await collection.ReplaceO...
Rabe asked 3/1, 2016 at 4:8
1
Solved
I have to insert many documents in a MongoDB collection, using the new C# 2.0 driver. Is using either collection.InsertManyAsync(...) or collection.BulkWriteAsync(...) making any difference? (parti...
Conjunction asked 3/10, 2015 at 10:31
1
Solved
I have the following aggregation pipline
var count = dbCollection.
Aggregate(new AggregateOptions { AllowDiskUse = true }).Match(query).
Group(groupby).
ToListAsync().Result.Count();
And this g...
Engaged asked 14/9, 2015 at 14:25
1
Solved
A general count query will be doing a
int count = collection.Find(filter).Count();
Now that loads all the records as per the filter, so lets says I have 1 million records and out of those 0.5 m...
Fusionism asked 11/9, 2015 at 10:59
1
Solved
I am using the MongoDB C# driver to create an index
When my app starts up, it creates the index as below
await collection.Indexes.CreateOneAsync(new BsonDocument("code", 1), new CreateIndexOption...
Legrand asked 1/9, 2015 at 6:24
3
Solved
I have many complex queries that I sometimes wish to check directly against Mongo for debugging \ explaining() purposes.
With the newer 2.0+ c# driver, i'm not sure how to do this. With the previo...
Stephi asked 17/8, 2015 at 10:7
1
Solved
I'm quite new to MongoDB and I'm using it in a Web Api to serve a mobile application.
Now, I need to run an aggregation and since I'm using C#, I would like to do it fluently by using the Aggregat...
River asked 20/8, 2015 at 6:24
2
Solved
In the old API (1.X) you could tell whether the server was connected or not by using the State property on the MongoServer instance returned from MongoClient.GetServer:
public bool IsConnceted
{
...
Matron asked 5/4, 2015 at 17:16
1
Solved
I try to update status field for object from p2l array
var update = Builders<BsonDocument>.Update.Set("p2l.$.status",BsonValue.Create(status))
It seems that code will work fine, but how to...
Reeve asked 4/8, 2015 at 9:0
1
Solved
Consider the following object structure stored as documents:
public class Foo
{
public string Id { get; set; }
public ICollection<FooBar> Bars { get; set; }
// ...
}
public class FooBar...
Beside asked 22/6, 2015 at 17:5
2
Solved
I am writing a very, very simple query which just gets a document from a collection according to its unique Id. After some frusteration (I am new to mongo and the async / await programming model), ...
Output asked 4/6, 2015 at 17:48
1
Solved
I'm having some trouble with the new C# 2.0 MongoDB driver and the aggregation pipeline.
Basically, I'm trying to return the most popular elements within an array field on the object. The field ty...
Digestif asked 26/5, 2015 at 5:40
1
I have some C# code which uses the old 1.x version of MongoDB driver which offers a generic save method using the MongoCollection.Save() method. However after upgrading to 2.0 this method appears t...
Benoni asked 21/5, 2015 at 22:12
2
Solved
I am using MongoDB.Driver 2.0.0.
Is there any way to see a generated script from linq to MongoDB?
For example my query is like:
IFindFluent<ProductMapping, ProductMapping> findFluent = Coll...
Yorke asked 18/5, 2015 at 14:41
1
Solved
The interface of MongoDB has completely changed from the previous one.
Here you can see the official documentation with some examples about how to search, insert and update but what about upserts?
...
Argentic asked 6/5, 2015 at 16:35
1
Solved
I am using MongoDB c# driver 2.0. I a trying to get a collection without specifying a type or class. Observe:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
...
Firing asked 30/4, 2015 at 1:7
1
Solved
What's the new way to build indexes with the new driver 2.0?
There's no documentation whatsoever about this.
Apparently this now works with the new IndexKeysDefinitionBuilder<> interface but...
Effervesce asked 8/4, 2015 at 1:41
1
Solved
From the mongoDB.Driver docs (http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-csharp-driver/)
Get a Reference to a Server Object
To get a reference to a server object from the clie...
Elliott asked 5/4, 2015 at 12:6
© 2022 - 2024 — McMap. All rights reserved.