0
我正在寫一個復位數據的方法對我的流星的應用程序,刪除數據庫,創建一個用戶,爲此用戶生成等我使用xolvio聲明服務器端方法,一些假的數據:清潔和帳戶包來完成:復位數據流星方法
import {Accounts} from 'meteor/accounts-base';
import {resetDatabase} from 'meteor/xolvio:cleaner';
Meteor.methods({
// ..
'resetData':()=> {
resetDatabase(null,()=>{
Accounts.onCreateUser((options, user) => console.log(user));
Accounts.createUser({
username: 'bob',
email: '[email protected]',
password: 'rastamanvibration',
profile: {
first_name: 'Bob',
last_name: 'Marley'
}
});
});
}
});
這似乎很直截了當地我呢,我發現了以下錯誤:
Exception while invoking method 'resetData' Error: insert requires an argument
W20170622-23:28:16.817(-7)? (STDERR) at [object Object].insert (packages/mongo/collection.js:468:11)
W20170622-23:28:16.819(-7)? (STDERR) at [object Object]._.each.Mongo.Collection.(anonymous function) [as insert] (packages/aldeed_collection2-core.js:232:19)
W20170622-23:28:16.820(-7)? (STDERR) at AccountsServer.meteorInstall.node_modules.meteor.accounts-base.accounts_server.js.Ap.insertUserDoc (packages/accounts-base/accounts_server.js:1328:25)
W20170622-23:28:16.821(-7)? (STDERR) at meteorInstall.node_modules.meteor.accounts-password.password_server.js.createUser (packages/accounts-password/password_server.js:1050:25)
W20170622-23:28:16.822(-7)? (STDERR) at AccountsServer.meteorInstall.node_modules.meteor.accounts-password.password_server.js.Accounts.createUser (packages/accounts-password/password_server.js:1119:10)
W20170622-23:28:16.823(-7)?
...
有你綁一個簡單的模式,以流星的用戶?此外,這個包指出它的工作只是在'''debugOnly''' enveronment – blueren
我不會創建流星用戶一個簡單的模式,它看起來並不像我需要。此外,這是在運行流星調試發生... – lvlzqz
錯誤實際上是沒有返回上Accounts.onCreatedUser回調用戶! woopsie – lvlzqz