findAndModify failed: Unknown modifier: _id

Hello what is problem ? Google dont know about this problem

Command findAndModify failed: Unknown modifier: _id. Expected a valid update modifier or pipeline-style update specified as an array.

Hi @alexov_inbox,

This indicates there is a problem with your findAndModify syntax. Can you comment with an example of your update command as well as the version of driver you are using?


 BsonClassMap.RegisterClassMap<X>(c => { 
                c.MapIdField(f => f.Email);

 var m = new X
                Email = email,
                Language = language,
                Password = password,
                EntryDate = DateTime.UtcNow,
                FindCount = 0

            var u = 
                new UpdateDefinitionBuilder<X>().Combine(
                    Builders<X>.Update.Inc(f => f.FindCount, 1), 
                    new ObjectUpdateDefinition<X>(m));
            MailRaws.FindOneAndUpdate<X>(f => f.Email == email, u, new FindOneAndUpdateOptions<X> {IsUpsert = true});