0
The code checks if the "field" field is empty, you need to use one model, otherwise the other. Is there a much better solution?
if c.Query("field") != "" {
var user models.UserModelOmitempty
err = usersCollection.FindOne(ctx, bson.M{"_id": objId}, opts).Decode(&user)
if e...