Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Meteor.users.find().count() === 0) {
- var testUserDetails = {
- email: 'testEmail@gmail.com',
- password: 'testPassword'
- };
- console.log("Creating the Test User");
- var newUserId = Accounts.createUser(testUserDetails);
- Meteor.users.update({
- _id: newUserId
- }, {
- $set: {
- services: {
- google: {
- email: "testEmail@gmail.com"
- }
- }
- }
- });
- } else {
- console.log("There are already users in the Test database");
- }
- console.log('***** Finished loading default fixtures *****');
- },
- {
- "_id" : "Dw2xQPDwKp58RozC4",
- "createdAt" : ISODate("2015-07-30T04:02:03.261Z"),
- "services" : {
- "password" : {
- "bcrypt" : "asdfasdfasdfdsafsadfasdsdsawf"
- },
- "resume" : {
- "loginTokens" : [ ]
- }
- },
- "emails" : [
- {
- "address" : "testEmail@gmail.com",
- "verified" : false
- }
- ]
- }
- var user = Meteor.users.findOne({
- _id: newUserId
- });
- var servicesUserData = user.services;
- servicesUserData.google.email = "your_new_email@gmail.com";
- Meteor.users.update({
- _id: newUserId
- }, {
- $set: {
- "services": {
- servicesUserData
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement