4

In my server fixture, I'm populating the database with some test users using the Accounts.createUser function. Now, I'm trying to figure out how to flag the email of the created user as verified.

I've tried to set the verified flag directly but it doesn't work:

Meteor.users.findOne(userId).emails[0].verified = true
4

1 に答える 1

7

ユーザーを更新して、検証済みフラグを true に設定する場合。これを試して。

Meteor.users.update(userId, {$set: {"emails.0.verified" :true}});

emails: []これにより、配列内の最初の電子メールが更新されます。

于 2013-06-08T17:22:47.937 に答える