Php Jenssegers MongoDB“;“类似查询”;在ISODate上返回空白数组

Php Jenssegers MongoDB“;“类似查询”;在ISODate上返回空白数组,php,mongodb,laravel-4,jenssegers-mongodb,Php,Mongodb,Laravel 4,Jenssegers Mongodb,我有以下查询,但它返回一个空数组(我知道这个查询应该返回一条记录) 如果我删除->where('created_at','like',“%{$created_at}%”)它返回的所有内容都很好,但我想要今年和本月的内容,但当我将其放入时,查询不起作用 数据库中的日期为ISODate格式 “创建时间”:ISODate(“2015-02-03T16:29:26.965Z”) 我猜是因为ISODate格式。我如何得到我需要的结果 谢谢使用此代码: $created_at = new DateTime(

我有以下查询,但它返回一个空数组(我知道这个查询应该返回一条记录)

如果我删除
->where('created_at','like',“%{$created_at}%”)
它返回的所有内容都很好,但我想要今年和本月的内容,但当我将其放入时,查询不起作用

数据库中的日期为ISODate格式
“创建时间”:ISODate(“2015-02-03T16:29:26.965Z”)

我猜是因为ISODate格式。我如何得到我需要的结果

谢谢使用此代码:

$created_at = new DateTime(date('F jS Y h:i:s A', strtotime('first day of ' . date('F Y'))));

$content = ContentModel::where('userId', $id->_id)
            ->where('created_at', '>', $created_at)
            ->orderBy('fav', 'DESC')
            ->get();

在这个代码中,
$created_at
变量表示当前月份的第1天。

我检查了上次运行的查询:
{“query”:“content.find({“userId”:“545b08c10f6e807b0a8b4567”,“created_at”:{“rege”‌​x“^2015-02$”,“flags:“i”},[]),“bindings:[],“time”:0.04}
这似乎是正确的,但任何人都不会返回任何内容??请帮助我,我仍然无法理解这是否有效,我正在得到我需要的结果,但您能否解释一下
like查询
不起作用的原因?将此标记为应答,因为在处创建的
字段以ISODate格式存储日期,并且它不是一个普通字符串。所以我们不能在这里使用like查询。
$created_at = new DateTime(date('F jS Y h:i:s A', strtotime('first day of ' . date('F Y'))));

$content = ContentModel::where('userId', $id->_id)
            ->where('created_at', '>', $created_at)
            ->orderBy('fav', 'DESC')
            ->get();