java - Automatic field creation for Bulk Write operations mongodb -
hi need execute bulk insert automatic field createdon [ timestamp ] ,
as of manually creating createdon timestamp , set document , calling insert method. inserting single document ok,
but not efficient executing bulkinsert lacks of records ,
can show how execute bulkinsert data automatic field
or suggest better solution creating automatic field in mongodb
actual data bulkwrite insert:
bulkinsertlist:
[ { fieldone:val, fieldtwo:val, fieldthree:val, fieldfour:val }, { fieldone:val, fieldtwo:val, fieldthree:val, fieldfour:val }, { .. } .., ]
bulk write should insert data createdon timestamp,
expected result,
bulkinsertlist: [ { fieldone:val, fieldtwo:val, fieldthree:val, fieldfour:val, createdon: timestamp }, { .. }, { .. } ]
Comments
Post a Comment