Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. if (Merchants.find().count() === 0) {
  2. console.log("No merchants documents exist: Importing merchants.json to mongodb.")
  3.  
  4. // Prase merchant.json data for insert.
  5. var data = JSON.parse(Assets.getText("merchants.json"));
  6.  
  7. // Perform loop that will insert each object from merchant.json.
  8. data.forEach(function (obj, index, array) {
  9. Merchants.insert(obj);
  10. });
  11. }
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement