Closed VerasThiago closed 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.
Need to find how to identify type as ObjectId.
Solved with ID primitive.ObjectID bson:"_id,omitempty"
ID primitive.ObjectID bson:"_id,omitempty"
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.
Need to find how to identify type as ObjectId.