我正在使用
"jenssegers/mongodb": "3.2.*"
我的查询如下所示,
$query= DB::connection('mongodb')->collection('folder_master')
->where('email_account_id',1)->get();
尽管数据库中存在价值,但它没有给我任何结果。
如果我使用以下查询
$query= DB::connection('mongodb')->collection('folder_master')->get();
然后它给了我所有记录,但是条件不起作用。
我的预期结果低于
Array
(
[0] => Array
(
[_id] => MongoDB\BSON\ObjectId Object
(
[oid] => 5bea89ac19f043251000347d
)
[0] => Array
(
[folder_name] => Archive
[status] => Active
[primary_folder] => 0
[email_account_id] => 1
[created_at] => Array
(
[date] => 2018-11-13 08:22:04.000000
[timezone_type] => 3
[timezone] => UTC
)
[created_by] => 0
)
)
)
存储在数据库中有什么问题吗??
这是存储在mongodb中的json
{
"_id" : ObjectId("5bea89ac19f043251000347d"),
"0" : {
"folder_name" : "Archive",
"status" : "Active",
"primary_folder" : NumberInt(0),
"email_account_id" : NumberInt(1),
"created_at" : {
"date" : "2018-11-13 08:22:04.000000",
"timezone_type" : NumberInt(3),
"timezone" : "UTC"
},
"created_by" : NumberInt(0)
}
}
请帮助我解决此类问题