Skip to content

Instantly share code, notes, and snippets.

@Streemo
Created October 28, 2014 02:52
Show Gist options
  • Save Streemo/09fd2456fc1095390c32 to your computer and use it in GitHub Desktop.
Save Streemo/09fd2456fc1095390c32 to your computer and use it in GitHub Desktop.
var bobId = Meteor.users.insert({
profile: {name: 'Bob Jones'}
});
var bob = Meteor.users.findOne({_id: bobId});
for (var i = 0; i < 45; i++) { Posts.insert({
title: 'Test post #' + i,
author: bob.profile.name,
userId: bob._id,
url: 'http://google.com/?q=test-' + i, submitted: now - i * 3600 * 1000, commentsCount: 0
});
}
//all of the documents created in this file have _id as string type when accessed in mongo shell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment