我尝试查询一些不在整数范围之间的数据,对此我有一些问题。
现在,我设法查询了“介于”范围内:
{ '$where': "#{some_method(field)} <= #{value[1]} && #{some_method(field)} >= #{value[0]}" }
我需要搜索不在所提供范围内的数据。我该怎么办?
答案 0 :(得分:1)
您可以使用$users = User::on('connection1')->where('tenant', 'foo')->get();
foreach ($users as $user) {
$user->setConnection('connection2');
$user->save();
}
运算符编写查询来获取文档,而不是在特定范围内。
例如。以下查询将为您提供值不在50到100之间的文档。
$or