title: Mongodb : resquest between two collections
body: <p>Here is the problem I'm struggling with :</p>
  
  <p>I have two collections in mongodb :</p>
  
  <p>One User and one Contract which contains a field conUser that references a User.</p>
  
  <p>I would like to find all the users that don't have any contract.</p>
  
  <p>How can I query that ?</p>
  
  <p>Thank you very much :) </p>
  
  <p>Here is a sample of my Users :</p>
  
  <pre><code>{
      "_id" : ObjectId("5981aae07f6e1da1030041a7"),
      "usrCreatedAt" : "2017-08-02 12:35:12",
      "usrMail" : "lkjlh@cncnn.com",
      "usrFirstname" : "ezaeddd",
      "usrLastname" : "aze",
      "usrDocStatus" : "creating"
  },
  {
      "_id" : ObjectId("58d3ec3c7f6e1d93060041a8"),
      "usrMail" : "aaaa.bbbb@gmail.com",
      "usrFirstname" : "AAAAA",
      "usrLastname" : "BBBBB",
      "usrDocStatus" : "creating"
  },
  {
      "_id" : ObjectId("56eae6b87f6e1d25130041a8"),
      "usrMail" : "barbara_bhdgxat_bushaksky@tfbnw.net",
      "usrFirstname" : "Barbara",
      "usrLastname" : "Bushaksky",
      "usrDocStatus" : "creating"
  }
  </code></pre>
  
  <p>And some Contracts :</p>
  
  <pre><code>{
      "_id" : ObjectId("58d3ec3f7f6e1d93060041a9"),
      "conDocStatus" : "creating",
      "conBeginAt" : "2017-03-16",
      "conEndAt" : "2019-04-10",
      "conUser" : {
          "$ref" : "User",
          "$id" : ObjectId("58d3ec3c7f6e1d93060041a8"),
          "$db" : "angios"
      },
      "conUpdatedAt" : "2017-08-01 14:10:07"
  },
  {
      "_id" : ObjectId("56aef7ca3ce0417db7d761da"),
      "conDocStatus" : "creating",
      "conBeginAt" : "2016-02-12",
      "conUser" : {
          "$ref" : "User",
          "$id" : ObjectId("56eae6b87f6e1d25130041a8"),
          "$db" : "angios"
      }
  }
  </code></pre>
  
  <p>The request should return :</p>
  
  <pre><code>{
      "_id" : ObjectId("5981aae07f6e1da1030041a7"),
      "usrCreatedAt" : "2017-08-02 12:35:12",
      "usrMail" : "lkjlh@cncnn.com",
      "usrFirstname" : "ezaeddd",
      "usrLastname" : "aze",
      "usrDocStatus" : "creating"
  }
  </code></pre>