[CSHARP-1548] Create User on database version 2.4.5 Created: 28/Jan/16 Updated: 05/Apr/19 Resolved: 28/Jan/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 2.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Kevin Versfeld | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
How does one create a user on a 2.4.5 version of MongoDB, but from the C# driver version 2.2? |
| Comments |
| Comment by Craig Wilson [ 28/Jan/16 ] |
|
Gotcha, makes sense. If the above doesn't work for you, let us know. Craig |
| Comment by Kevin Versfeld [ 28/Jan/16 ] |
|
Thanks! |
| Comment by Craig Wilson [ 28/Jan/16 ] |
|
Hi Kevin, For server 2.4, you'll want to insert a users document into the system.users collection. You can see the form of it here: https://docs.mongodb.org/v2.4/reference/privilege-documents/#<database>.system.users. Basically, get a collection of type BsonDocument, create a BsonDocument using the above format, and call InsertOne. Any particular reason you want to do this from the driver instead of the shell? Craig |