title: MongoDb Handle Multiple Document Insert?
body: <p>I am new to Mongodb lets say i need to insert <code>3 documents</code> in  3 different <code>collections</code> for example lets say i have a <code>department</code>, <code>students</code> and  <code>department_membership</code> collections. when department head add one <code>student</code> to the <code>department</code> , so that time i need insert document like </p>
  
  <blockquote>
    <p>{ _id: 123, name: "st_name", email: "test@gmail.com"  }</p>
  </blockquote>
  
  <p>in <code>student</code> collection,</p>
  
  <blockquote>
    <p>{  _id: 2356, dept_id: 12 , added_by_whom_id: 253, student_id: 123}</p>
  </blockquote>
  
  <p>in <code>department</code> collection</p>
  
  <blockquote>
    <p>{ _id: 13111, dept_id: 12, student: { _id: 123, name: "st_name"  } }</p>
  </blockquote>
  
  <p>in <code>department membership</code> collection</p>
  
  <p>what i want is to either  insert all documents in respective collections or it should fail, how to handle this? </p>