Mongodb 如何将用户手动添加到Meteor.users集合?

Mongodb 如何将用户手动添加到Meteor.users集合?,mongodb,meteor,meteor-accounts,Mongodb,Meteor,Meteor Accounts,我有一个超级用户,我手动添加,这个用户可以通过我给他的表单手动其他用户 假设我保存用户输入的输入,如下图所示: Session.set('name', t.find('#name').value); Session.set('password', t.find('#pass').value); Session.set('email', t.find('#email').value); 在检查电子邮件和用户名是否不匹配后,如何将这些值存储在Meteor.users的会话中 在将密码存储到数据库之

我有一个超级用户,我手动添加,这个用户可以通过我给他的表单手动其他用户

假设我保存用户输入的输入,如下图所示:

Session.set('name', t.find('#name').value);
Session.set('password', t.find('#pass').value);
Session.set('email', t.find('#email').value);
在检查电子邮件和用户名是否不匹配后,如何将这些值存储在Meteor.users的会话中


在将密码存储到数据库之前,我如何加密密码?

当从客户端调用此代码时,它是:

Meteor.call('createUser','someemail@gmail.com','password123',function(err,res){
  .....
})
在Meteor.users集合中创建一个用户,其id在方法中如下所示

Meteor.methods({
  createUser(email,password){
    check(email,String);
    check(password,String);    
    let id = Accounts.createUser({
      email: email,
      password: password,
      profile: {} //anything you like to add to profile.
    })    
  }
})

当从客户端调用时,此代码为:

Meteor.call('createUser','someemail@gmail.com','password123',function(err,res){
  .....
})
在Meteor.users集合中创建一个用户,其id在方法中如下所示

Meteor.methods({
  createUser(email,password){
    check(email,String);
    check(password,String);    
    let id = Accounts.createUser({
      email: email,
      password: password,
      profile: {} //anything you like to add to profile.
    })    
  }
})

为什么你不能创建一个用户?我正在进行服务器端meteor调用,并使用accounts.createUser()meteor方法创建用户?是的,但将用户输入插入users.collection的mongodb代码是什么?@HafizAllyLalani如果没有错,你的意思是我在服务器端实现了一个功能,将用户插入Meteor.users集合?然后在客户端收集?我说得对吗?如果我不是,请纠正我:)在下面发布了一些代码,如果您需要任何特定的方法来完成您的工作,请告诉我。为什么您不能创建一个用户?我正在进行服务器端meteor呼叫,并使用accounts创建用户。createUser()meteor方法?是的,但是将用户输入插入users.collection的mongodb代码是什么?@HafizAllyLalani如果没有弄错的话,你的意思是我在服务器端实现了一个将用户插入meteor.users集合的功能?然后在客户端收集?我说得对吗?请纠正我,如果我不是:)张贴了一些代码下面,让我知道,如果你需要任何具体的方式来做你的工作。