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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -