[CSHARP-21] Database collections created by the c# driver do not prepend the "<dbname>." to the collection name Created: 01/Mar/10  Updated: 02/Mar/10  Resolved: 02/Mar/10

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Felipe Lima Assignee: Sam Corder
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Database collections created by the c# driver do not prepend the "<dbname>." to the collection name
Example:
/* Prerequisite: testdb does not exist */
Mongo mongo = new Mongo();
mongo.Connect();
Database db = mongo["testdb"];
db["testcollection"].Insert(new

{ Doc = "Doc" }

);

-> Expected: the created collection name is "testdb.testcollection"
-> Observed: the created collection name is "testcollection"

OBS: Verified with the mongo.exe command-line tool



 Comments   
Comment by Felipe Lima [ 02/Mar/10 ]

You are correct. Thanks!

Comment by Sam Corder [ 02/Mar/10 ]

Not an issue.

Comment by Sam Corder [ 02/Mar/10 ]

You are probably doing db.testdb.testcollection.insert(

{...}) at the shell when all you need is db.testcollection.insert({...}

). Beware that when you start up the shell it automatically connects you to the "tests" database. If you want a different one enter "use name_of_your_db_you_want_to_use" before doing any inserts.

Comment by Felipe Lima [ 01/Mar/10 ]

It looks like the C# driver is correctly prepending the "dbname." string, but, instead, collections created using mongo.exe are prepending "dbname.dbname.", which is causing the weird behavior.
Tested with MongoDB 1.2.3

Generated at Wed Feb 07 21:35:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.