Split the customerName into firstName..the fisrt letter..the first index

PHOTO EMBED

Fri Apr 30 2021 11:39:42 GMT+0000 (Coordinated Universal Time)

Saved by @tapasdash #nodejs #mongoose #mongodb

db.customers.updateMany({},
  [{ $set : { m : {$arrayElemAt:[{ $split: ["$customerName", " "] },0]}} }],

);
content_copyCOPY