I searching a way to map the Bson objects defined using readable names ("category") to shorts names ("ct") and limit the space occuped by the items names in the main document base. I have seen this using others Drivers but what about using official Driver. How i can make, where is the best place to define. Can use longnames in queries and retrieve short contents?.
thanks.
Since nobody has actually given the answer to the question, here it is.
With the official driver you can do this by decorating a property name with BsonElement. For example:
public class SomeClass
{
public BsonObjectId Id { get; set; }
[BsonElement("dt")]
public DateTime SomeReallyLongDateTimePropertyName { get; set; }
}
Now the driver will use "dt" as the BSON property name.
However, at this time there is no way to query using the POCO property name. You would need to use "dt" in your queries. There is a separate project that is built on top of the C# driver that provides LINQ style querying capabilities, but I have not tested it to verify if it will do what you are asking.