doutan1671 2018-11-13 09:21
浏览 34

条件不适用于流明和mongodb

I am using

"jenssegers/mongodb": "3.2.*"

my query is like below,

$query= DB::connection('mongodb')->collection('folder_master')
                ->where('email_account_id',1)->get();

it is not giving me any result though there is value present in database.

if I am using query as below

$query= DB::connection('mongodb')->collection('folder_master')->get();

then it is giving me all the records but where condition is not working.

my expected result is below,

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
                )

        )
)

is there any issue while storing in database ????

here is the json which is stored in mongodb

{ 
    "_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)
    }
}

please help me to resolve this type of issue

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?