apc-unb / apc-api

MIT License
4 stars 0 forks source link

Mongo Compass ID #8

Closed VerasThiago closed 5 years ago

VerasThiago commented 5 years ago

Somehow, when you insert a document in mongo db, the ID created is a bson.NewObjectId(), however, the variable type shown in mongo compass is String. In Postman, the type is shown correctly.

tmp

image

Need to find how to identify type as ObjectId.

VerasThiago commented 5 years ago

Solved with ID primitive.ObjectID bson:"_id,omitempty"