-3
可以任何一個在php下執行使用php寫入查詢。如何編寫mongodb查找與運算符使用gretter然後少於查詢在php
db.MSISDN_RANG.find({$和:[{msisdn_start_range:{$ LT:919967288367}},{msisdn_end_range:{$ GT:919967288367}}]}).pretty()
可以任何一個在php下執行使用php寫入查詢。如何編寫mongodb查找與運算符使用gretter然後少於查詢在php
db.MSISDN_RANG.find({$和:[{msisdn_start_range:{$ LT:919967288367}},{msisdn_end_range:{$ GT:919967288367}}]}).pretty()
嘗試這種情況:只需更改dbName
和collectionName
<?php
$connection = new MongoClient(sprintf('mongodb://%s:%d/%s', '127.0.0.1', '27017', 'dbName'));
$db = $connection->selectDB('dbName');
$table = $db->selectCollection('collectionName');
$cursor = $table->find(
array(
'msisdn_start_range' => array('$lt' => 919967288367),
'msisdn_end_range' => array('$gt' => 919967288367)
)
);
$cursor = iterator_to_array($cursor);
echo "<pre>";
print_r($cursor);