沒有錯誤&也沒有結果。 我的查詢看起來是這樣的:
Array
(
[$or] => Array
(
[0] => Array
(
[title] => Array
(
[$regex] => /.*Palmer \- The ArT oF.*/
[$options] => i
)
)
)
)
如果我改變title
從數據庫整個字符串匹配,它的工作原理。
我用MongoChef嘗試了相同的查詢,它工作。
也試圖與改變title
值:
1. new MongoDB\BSON\Regex('Palmer - The ArT oF', 'i');
2.直接的正則表達式字符串/.*Palmer \- The ArT oF.*/i
......但依然沒有結果。
這是find()
操作的Cursor對象:
MongoDB\Driver\Cursor Object
(
[cursor] => Array
(
[stamp] => 0
[is_command] =>
[sent] => 1
[done] => 1
[end_of_event] => 1
[in_exhaust] =>
[has_fields] =>
[query] => stdClass Object
(
[$query] => stdClass Object
(
[$or] => Array
(
[0] => stdClass Object
(
[title] => stdClass Object
(
[$regex] => /.*Palmer \- The ArT oF.*/
[$options] => i
)
)
)
)
)
[fields] => stdClass Object
(
)
[read_preference] => Array
(
[mode] => 1
[tags] => Array
(
)
)
[flags] => 0
[skip] => 0
[limit] => 0
[count] => 1
[batch_size] => 0
[ns] => laravel.movie_list
)
[server_id] => 1
)
我使用mongo-php-library此操作。