mongodb - Mongo Schema-less Collections & C# -
I am searching for Mongo as an alternative to relational database, but I have a problem with the concept of schemale archives I am walking in
It sounds great in principle, but as soon as you tie a model for a collection, the model becomes your definition schema. You can not just add or remove fields from your model And hopefully it will continue to work. I see a problem here that manages the changes along with a relational database in your relationship, in which you need some type of script, so that one can migrate from one version of the database schema to another.
Am I coming from this wrong angle?
EDIT: It is worth noting that these problems are clearly also in the relational database, as well as to ensure that the items of their collection are stored in their domain model What approach do you take to stay in sync? But I'm specifically asking for strategies in schemaless database and reducing the problem especially using Mongo Thanks! Schema migration with Mojo DBB is actually very less painful compared with SQL Server.
It is easy to add a new field, old records are empty with it or you can use the attributes to control the default value When this is done serial, the The removal of the field is quite easy, you can use the With these places, there is no need to convert every record into a new schema, you can do it more slowly when updating your records gradually in the background. PS, since you are also interested in using mobility with Mongo, here I have tried together those lines and here is an updated post completely. [BsonDefaultValue ("abc", SerializeDefaultValue = false)
[BsonIgnoreIfNull] attribute is also easy to leave empty objects from the document.
[BSNextraElements] (see) to collect and preserve them, or to emit them You can use
[BsonIgnoreExtraElements] .
Comments
Post a Comment