javascript - Mongodb: Specify field data type, collection _id to be datetime -
i have collection _id objects should datetime.
the collection updated in javascript , performs aggregation specific time.
var aggregated = { '_id': new date()}; ... work aggregated ... updatedb.save(aggregated); how specify _id object should of type datetime. more generally, how specify field should particular type.
thanks,
you can't.
mongodb schemaless , heterogeneous database. field of document (including _id) can of type. there no way enforce type constraints on database level.
Comments
Post a Comment