sql >> Database teknologi >  >> NoSQL >> MongoDB

Hvordan vælger dette i MongoDB

 db.rendaxeducacao.aggregate([
        {$math : {idh : 2000}                  //  fiter only where idh=2000
        },
        {$group: { _id: 1, 
                   max_idheducacao : {$max : $idheducacao}  // find max
          }
        },
        {$project:{                          //  select cidade 
               _id:0,
               cidade:1
          }  
        } 

  ])

rendaxeducacao =samling




  1. MongoDB:Lås og lås samlingen op manuelt

  2. Mongoose to-niveau population ved hjælp af KeystoneJs

  3. Cluster Failover

  4. MongoDb TTL på indlejret dokument er muligt?