public class Model { [BsonId] public ObjectId _id { get; set; }
}
{
"_id": "string"
}{
"_id": {
"timestamp": 0,
"machine": 0,
"pid": 0,
"increment": 0,
"creationTime": "2016-08-29T09:32:26.630Z"
}
}public class Model { [BsonId] public ObjectId _id { get; set; } }
public class Program { public static void Main(string[] args) { var m = new Model { _id = ObjectId.Parse("112233445566778899aabbcc") }; var json = m.ToJson(); Console.WriteLine(json); Console.ReadLine(); } }
public class Model { [BsonId] [BsonRepresentation(BsonType.String)] public ObjectId _id { get; set; } }
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/dab91ca2-9d2f-4dce-b716-cdb2277278b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public class Model
{
[BsonId] [BsonRepresentation(BsonType.ObjectId)] public string _id { get; set; }}--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/81f36433-b3e9-43ca-be76-31d43f1e0a77%40googlegroups.com.