Home > database >  Ifnull mongo have similar to mysql, oracle NVL, such number of culvert or functions
Ifnull mongo have similar to mysql, oracle NVL, such number of culvert or functions

Time:09-28

Ifnull mongo have similar to mysql, oracle NVL, such number of culvert or functions

CodePudding user response:

Db. Buyer. Aggregate ([{$project: {userNick userID: 1:1, the userName: {$ifNull: [" $userName ", "$userNick"]}, _id: 0}}])

I am this way to achieve a goal, but I don't know how efficiency, or there are other better way?

CodePudding user response:

CodePudding user response:

Is not null: [' sub section name=& gt; [' ne '=& gt; null]]
Null: [' sub section name=& gt; null]
  • Related