I’d like to know if there’re any log when you try for example to insert something into field Name of document Customer. But the field Name has been renamed in the mongodb for FirstName ?
Because I just tried something like that, I renamed every field’s name called Name into FirstName of my collection of Customer document. And in my C# code, I have a query which used to work, it removes a customer with Name “John”. I execute it, the query runs without errors but nothing happens in the database. It should tell me that field Name doesn’t exist anymore. How do you detect that ?
Thanks.
John
[EDIT]
my C# code:
public void DeleteOverride(Guid applicationId, string settingKey, string name)
{
var query = Query.And(Query.EQ("_id", applicationId), Query.EQ("Settings.Key", settingKey));
var update = Update.Pull("Settings.$.Overrides", new BsonDocument {{"Name", name}});
Run(database => database.GetCollection<ApplicationViewModel>("Applications").Update(query, update));
}
Here’s in my example: the field Name has been renamed for DefinedFor in the dababase for every documents of my collection Application, I run it, and no exceptions has been thrown. My visual studio has CLR exceptions enabled.
There is not such log. You should care about fields renaming yourself.
You can write unit test for each update to make sure that updates work correctly and detect problems with renames.
I guess string names in queries/updates is the weakest side of the official driver.