.Decode(&user)
запрос даже не происходит и мы просто строим query. Но тогда почему в options.FindOne().SetProjection(bson.M{"username": 1})
есть этот FindOne()?var user usernameOnly
users.FindOne(ctx, bson.M{"username": "kotcich"}).SetProjection(bson.M{"username": 1}).Decode(&user)
users.FindOne(ctx, (bson.M literal)).SetProjection undefined (type *mongo.SingleResult has no field or method SetProjection)