"bookName": "I've been discovered",
"bookGenre": {
"0": "Classics",
"1": "Fantasy",
"2": "Romance"
}
"bookName": "Doctor Who",
"bookGenre": {
"0": "Classics",
"1": "Biography"
}
"bookName": "I don't want to tread carefully",
"bookGenre": {
"0": "Classics",
"1": "Fantasy",
"2": "History"
}
我想获得所有经典类型的书籍,但不包括幻想和历史类型。
$genre = array("Classics");
$genreNot = array("Fantasy", "History");
$q = find(array("bookGenre" => array('$in' => $genre), "bookGenre" => array('$nin' => $genreNot)));
在这个查询中,我得到了我所有的书,但没有带来类型幻想和历史不起作用的例外。如何向排除的类型作品提出请求?