MongoVue and Guid

I would like to insert Guid using the mongoVue tool, how can I do this?

To explain the context, I used json to copy my collection (thanks to the Text View tab) and paste it into my txt file instead of using mongodump. But when I create a new collection and paste it into json from the previous copy, my binary guid type now appears as an "object identifier", then the problem is this: I can not match the object identifier in my C # code with my Guid field. This is why I would like to know if guid can be inserted into MongoVue.

Thanks guys. John

+3
source share
3 answers

You can use the following notation to enter a GUID in MongoVUE:

{
guid_field: new Guid("3bed978a-dc87-4fa4-8a1a-f0679387fa7e")
}

Guid (Guid.NewGuid()), :

{
guid_field: new Guid()
}

3.

+2

:

public class C {
    public Guid Id;
    public int X;
}

MongoVUE:

/* 0 */
{
  "_id": {
    "$binary": "q4TTjt8k4UyaJI6FwuZ1EQ==",
    "$type": "03"
  },
  "X": 1
}

GUID BSON 3, ObjectId.

GUID MongoVUE, BSON 3. Base64 .

, UUID MongoDB. (#, Java Python), UUID, UUID, .

4 UUID UUID (16 , UUID).

The current version of the C # driver (version 1.1 has just been released) has some experimental support for working with various GUID representations (see the GuidRepresentation listing and where it is used).

0
source

All Articles