티스토리 뷰
db.getCollection("quiz3").find({
$expr : { "$and" : [
{$ne : ["$status.code", "999"]},
{$lte : [{$strLenCP : "$title"}, 26]},
{$eq : ["$format.type", "TEXT"]},
{$eq : ["$format.answerType", "MULTIPLE_CHOICE"]},
{$allElementsTrue : {$map : {
"input" : "$examples.body", "in" : {"$lte": [{"$strLenCP" : "$$this"}, 6]}
}}}
]
}}).limit(1000);
status 999 and title 길이가 26 이하이고 format.type 이 TEXT이고 format answerType 이 MULTIPLE_CHOICE 이고 example 배열에 json 값 중 body 의 텍스트 길이가 6 이하인 조건 검색
'데이터베이스 > MongoDB' 카테고리의 다른 글
[업데이트] document 데이터 일부 업데이트 하기 (0) | 2020.10.26 |
---|---|
MongoDB 검색 방법 (0) | 2020.02.11 |
댓글