Mongodb基礎実践(二)


前の文章では主にMongoDBのドキュメント、集合、データベースなどの操作とドキュメントの追加、削除、変更に関する知識を紹介し、次にクエリーに関する知識をまとめます.
MySQLでは、データ・クエリーが最適化の主な内容であることを知っています.読み書き分離などの技術は、データベース・クエリーの最適化を処理するために使用することができます.データベース・クエリーはシステムごとに重要な部分であることがわかります.findの簡単な使用について説明しましたが、比較的複雑なクエリーについて説明します.
一、データ照会
MySQLデータベースでは主にselectとwhere句を組み合わせてデータのクエリーを実現し、マルチテーブル連合クエリー、正規表現のサポートなど、特に強力な機能を備えています.ここではあまり紹介しません.ここでは主にMongoDBに関するクエリーを紹介し,MongoDBでは主にfind()でデータのクエリーを実現するとともに,いくつかの条件制限を用いることもできる.
1.1単一データの表示
前の記事ではfind()の使用について説明しましたが、クエリーデータのたびにすべてクエリーされ、その一部が表示され、it反復が使用できます.データの1つをクエリーしたい場合があります.具体的な操作は、特定のニーズに応じて実現されます.
MongoDBクエリーデータの構文
db.collection.find(query, projection)

Query:オプション、クエリーオペレータを使用してクエリー条件projectionを指定:オプション、投影オペレータを使用して返されるキーを指定します.クエリー時にドキュメント内のすべてのキー値を返します.このパラメータを省略するだけです(デフォルトでは省略).pretty()メソッドを使用して、構文フォーマットは次のように、読みやすい方法でデータを読み取ることができます.
>db.col.find().pretty()

pretty()メソッドは、すべてのドキュメントをフォーマットして表示します.
例:
db.winner.find().pretty()
{ "_id" : ObjectId("592e7d1caaa464fa8a557e95"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d1eaaa464fa8a557e96"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d1faaa464fa8a557e97"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d1faaa464fa8a557e98"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d21aaa464fa8a557e99"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d22aaa464fa8a557e9a"), "winne" : 1955 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec4"), "winne" : 41 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec5"), "winne" : 42 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec6"), "winne" : 43 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec7"), "winne" : 44 }

1.ある集合のすべてのデータを問い合わせる
db.winner.find()
{ "_id" : ObjectId("592e7d1caaa464fa8a557e95"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d1eaaa464fa8a557e96"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d1faaa464fa8a557e97"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d1faaa464fa8a557e98"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d21aaa464fa8a557e99"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d22aaa464fa8a557e9a"), "winne" : 1955 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec4"), "winne" : 41 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec5"), "winne" : 42 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec6"), "winne" : 43 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec7"), "winne" : 44 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec8"), "winne" : 45 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec9"), "winne" : 46 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557eca"), "winne" : 47 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ecb"), "winne" : 48 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ecc"), "winne" : 49 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ecd"), "winne" : 50 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ece"), "winne" : 51 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ecf"), "winne" : 52 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ed0"), "winne" : 53 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ed1"), "winne" : 54 }
Type "it" for more

デフォルトでは20個のデータが表示され、他のデータはit反復を入力できます.
2、データを表示する
find()はすべての結果を出力もので、中には同じ文書があるかもしれませんが、"_id"はきっと違います.この場合、findOne()メソッドを使用してクエリーしたり、dbを使用したりすることができます.winner.find({winne:1955}).limit(1).
db.winner.find({winne:1955})
{ "_id" : ObjectId("592e7d1caaa464fa8a557e95"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d1eaaa464fa8a557e96"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d1faaa464fa8a557e97"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d1faaa464fa8a557e98"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d21aaa464fa8a557e99"), "winne" : 1955 }
{ "_id" : ObjectId("592e7d22aaa464fa8a557e9a"), "winne" : 1955 }
     winner   winne=1955     ,  find()        ,       findOne()
db.winner.findOne({winne:1955})
{ "_id" : ObjectId("592e7d1caaa464fa8a557e95"), "winne" : 1955 }

      
db.winner.find({winne:1955}).limit(1)
{ "_id" : ObjectId("592e7d1caaa464fa8a557e95"), "winne" : 1955 }
     
findOne()    MySQL   distinct,           ,             
  NULL,
db.winner.findOne({winne:200888})
null
db.winner.find({winne:1955}).limit(1)    MySQL   limit    ,            。

3、一定の条件を満たすデータを検索する
MySQLでのクエリーでは、whereやフィールドなどの情報と組み合わせてデータをクエリーできますが、MongoDBでも可能で、いくつかの条件判断文をサポートすることができます.
書式設定

RDBMSの類似文
に等しい{: } db.col.find({"winne":"1995"}).pretty() where winne = '50'
より さい{:{$lt:}} db.col.find({"winne ":{$lt:50}}).pretty() where winne < 50
{:{$lte:}} db.col.find({"winne ":{$lte:50}}).pretty() where winne <= 50
より きい{:{$gt:}} db.col.find({"winne ":{$gt:50}}).pretty() where winne > 50
{:{$gte:}} db.col.find({"winne ":{$gte:50}}).pretty() where winne >= 50
しくない{:{$ne:}} db.col.find({"winne ":{$ne:50}}).pretty() where winne != 50
$gt -------- greater than   $gte --------- gt equal
$lt -------- less than      $lte --------- lt equal
$ne ----------- not equal

1、  winner   winne<50     
 db.winner.find({winne:{$lt :50}})
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec4"), "winne" : 41 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec5"), "winne" : 42 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec6"), "winne" : 43 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec7"), "winne" : 44 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec8"), "winne" : 45 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ec9"), "winne" : 46 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557eca"), "winne" : 47 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ecb"), "winne" : 48 }
{ "_id" : ObjectId("592e7e14aaa464fa8a557ecc"), "winne" : 49 }
{ "_id" : ObjectId("592e7e17aaa464fa8a557f28"), "winne" : 41 }
{ "_id" : ObjectId("592e7e17aaa464fa8a557f29"), "winne" : 42 }
{ "_id" : ObjectId("592e7e17aaa464fa8a557f2a"), "winne" : 43 }
{ "_id" : ObjectId("592e7e17aaa464fa8a557f2b"), "winne" : 44 }
2、  winner   40= 
  

4、MongoDB AND

MongoDB find() (key), (key) , :

>db.winner.find({key1:value1, key2:value2}).pretty()

#      
for(i=0;i<20;i++)db.info2.insert({name:"linux",
object:"SA",
company:"docker",
phone:i})
for(i=0;i<20;i++)db.info2.insert({name:"openstack",
object:"DBA",
company:"could",
phone:i})

#      
> db.info2.find()
db.info2.find()
{ "_id" : ObjectId("592f838dd276944818f7edb4"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 0 }
{ "_id" : ObjectId("592f838dd276944818f7edb5"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 1 }
{ "_id" : ObjectId("592f838dd276944818f7edb6"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 2 }
{ "_id" : ObjectId("592f838dd276944818f7edb7"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 3 }
{ "_id" : ObjectId("592f838dd276944818f7edb8"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 4 }
{ "_id" : ObjectId("592f838dd276944818f7edb9"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 5 }
{ "_id" : ObjectId("592f838dd276944818f7edba"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 6 }
{ "_id" : ObjectId("592f838dd276944818f7edbb"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 7 }
{ "_id" : ObjectId("592f838dd276944818f7edbc"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 8 }
{ "_id" : ObjectId("592f838dd276944818f7edbd"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 9 }
{ "_id" : ObjectId("592f838dd276944818f7edbe"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 10 }
{ "_id" : ObjectId("592f838dd276944818f7edbf"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 11 }
{ "_id" : ObjectId("592f838dd276944818f7edc0"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 12 }
{ "_id" : ObjectId("592f838dd276944818f7edc1"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 13 }
{ "_id" : ObjectId("592f838dd276944818f7edc2"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 14 }
{ "_id" : ObjectId("592f838dd276944818f7edc3"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 15 }
{ "_id" : ObjectId("592f838dd276944818f7edc4"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 16 }
{ "_id" : ObjectId("592f838dd276944818f7edc5"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 17 }
{ "_id" : ObjectId("592f838dd276944818f7edc6"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 18 }
{ "_id" : ObjectId("592f838dd276944818f7edc7"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 19 }
>db.info2.find().count()  #       
40
#  name=linux object=SA phone<5
db.info2.find({name:"linux",object:"SA",phone:{$lt:5}})
   
 db.info2.find({name:"linux",object:"SA",phone:{$lt:5}})
{ "_id" : ObjectId("592f838dd276944818f7edb4"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 0 }
{ "_id" : ObjectId("592f838dd276944818f7edb5"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 1 }
{ "_id" : ObjectId("592f838dd276944818f7edb6"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 2 }
{ "_id" : ObjectId("592f838dd276944818f7edb7"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 3 }
{ "_id" : ObjectId("592f838dd276944818f7edb8"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 4 }
  name=linux object=SA   5 
  

5 MongoDB OR
MongoDB MySQL AND , OR ,OR $or, :
>db.collections.find(
   {
      $or: [
         {key1: value1}, {key2:value2}
      ]
   }
).pretty()

# name=linux   object=redis
db.info2.find(
{$or:[{name:"linux"},{object:"redis"}]

}
)
db.info2.find(db.info2.find(
... {$or:[{name:"linux"},{object:"redis"}]{$or:[{name:"linux"},{object:"redis"}]
... 
... }}
... ))
{ "_id" : ObjectId("592f838dd276944818f7edb4"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 0 }
{ "_id" : ObjectId("592f838dd276944818f7edb5"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 1 }
{ "_id" : ObjectId("592f838dd276944818f7edb6"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 2 }
{ "_id" : ObjectId("592f838dd276944818f7edb7"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 3 }
{ "_id" : ObjectId("592f838dd276944818f7edb8"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 4 }
{ "_id" : ObjectId("592f838dd276944818f7edb9"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 5 }
{ "_id" : ObjectId("592f838dd276944818f7edba"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 6 }
{ "_id" : ObjectId("592f838dd276944818f7edbb"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 7 }
{ "_id" : ObjectId("592f838dd276944818f7edbc"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 8 }
{ "_id" : ObjectId("592f838dd276944818f7edbd"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 9 }
{ "_id" : ObjectId("592f838dd276944818f7edbe"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 10 }
{ "_id" : ObjectId("592f838dd276944818f7edbf"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 11 }
{ "_id" : ObjectId("592f838dd276944818f7edc0"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 12 }
{ "_id" : ObjectId("592f838dd276944818f7edc1"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 13 }
{ "_id" : ObjectId("592f838dd276944818f7edc2"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 14 }
{ "_id" : ObjectId("592f838dd276944818f7edc3"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 15 }
{ "_id" : ObjectId("592f838dd276944818f7edc4"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 16 }
{ "_id" : ObjectId("592f838dd276944818f7edc5"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 17 }
{ "_id" : ObjectId("592f838dd276944818f7edc6"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 18 }
{ "_id" : ObjectId("592f838dd276944818f7edc7"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 19 }
Type "it" for more
> itit
{ "_id" : ObjectId("592f8964d276944818f7eddc"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 0 }
{ "_id" : ObjectId("592f8964d276944818f7eddd"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 1 }
{ "_id" : ObjectId("592f8964d276944818f7edde"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 2 }
{ "_id" : ObjectId("592f8964d276944818f7eddf"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 3 }
{ "_id" : ObjectId("592f8964d276944818f7ede0"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 4 }
{ "_id" : ObjectId("592f8964d276944818f7ede1"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 5 }
{ "_id" : ObjectId("592f8964d276944818f7ede2"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 6 }
{ "_id" : ObjectId("592f8964d276944818f7ede3"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 7 }
{ "_id" : ObjectId("592f8964d276944818f7ede4"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 8 }
{ "_id" : ObjectId("592f8964d276944818f7ede5"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 9 }

6、ANDとORを
クエリphone<5,name=MongoDBまたはname=linux
db.info2.find({phone:{$lt:5},$or:[{name:"MongoDB"},{name:"linux"}]})
db.info2.find({phone:{$lt:5},$or:[{name:"MongoDB"},{name:"linux"}]})
{ "_id" : ObjectId("592f838dd276944818f7edb4"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 0 }
{ "_id" : ObjectId("592f838dd276944818f7edb5"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 1 }
{ "_id" : ObjectId("592f838dd276944818f7edb6"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 2 }
{ "_id" : ObjectId("592f838dd276944818f7edb7"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 3 }
{ "_id" : ObjectId("592f838dd276944818f7edb8"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 4 }
{ "_id" : ObjectId("592f8964d276944818f7eddc"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 0 }
{ "_id" : ObjectId("592f8964d276944818f7eddd"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 1 }
{ "_id" : ObjectId("592f8964d276944818f7edde"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 2 }
{ "_id" : ObjectId("592f8964d276944818f7eddf"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 3 }
{ "_id" : ObjectId("592f8964d276944818f7ede0"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 4 }

7、クエリー のソート
MySQLではorder by があり、descまたはascに って または を うことができ、MongoDBではsort() を いてソートを することができ、 えば6での についてphoneに ってソートすることができる.

db.info2.find().sort({phone:1})#ここでphoneはこのkeyに づいてソートされ、1は 、-1は を す.
db.info2.find({phone:{$lt:5},$or:[{name:"MongoDB"},{name:"linux"}]}).sort({phone:1})
{ "_id" : ObjectId("592f838dd276944818f7edb4"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 0 }
{ "_id" : ObjectId("592f8964d276944818f7eddc"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 0 }
{ "_id" : ObjectId("592f838dd276944818f7edb5"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 1 }
{ "_id" : ObjectId("592f8964d276944818f7eddd"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 1 }
{ "_id" : ObjectId("592f838dd276944818f7edb6"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 2 }
{ "_id" : ObjectId("592f8964d276944818f7edde"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 2 }
{ "_id" : ObjectId("592f838dd276944818f7edb7"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 3 }
{ "_id" : ObjectId("592f8964d276944818f7eddf"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 3 }
{ "_id" : ObjectId("592f838dd276944818f7edb8"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 4 }
{ "_id" : ObjectId("592f8964d276944818f7ede0"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 4 }

8、MongoDB Skip()
にlimit()、sort()、count()などの を しましたが、 に いskip()の を します.limit()を すると、あなたが したいくつかを することができますが、skip()の はいくつかスキップします.
db.info2.find({phone:{$lt:5},$or:[{name:"MongoDB"},{name:"linux"}]}).sort({phone:1})
{ "_id" : ObjectId("592f838dd276944818f7edb4"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 0 }
{ "_id" : ObjectId("592f8964d276944818f7eddc"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 0 }
{ "_id" : ObjectId("592f838dd276944818f7edb5"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 1 }
{ "_id" : ObjectId("592f8964d276944818f7eddd"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 1 }
{ "_id" : ObjectId("592f838dd276944818f7edb6"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 2 }
{ "_id" : ObjectId("592f8964d276944818f7edde"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 2 }
{ "_id" : ObjectId("592f838dd276944818f7edb7"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 3 }
{ "_id" : ObjectId("592f8964d276944818f7eddf"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 3 }
{ "_id" : ObjectId("592f838dd276944818f7edb8"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 4 }
{ "_id" : ObjectId("592f8964d276944818f7ede0"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 4 }
  skip()  
db.info2.find({phone:{$lt:5},$or:[{name:"MongoDB"},{name:"linux"}]}).sort({phone:1}).skip(3)
{ "_id" : ObjectId("592f8964d276944818f7eddd"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 1 }
{ "_id" : ObjectId("592f838dd276944818f7edb6"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 2 }
{ "_id" : ObjectId("592f8964d276944818f7edde"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 2 }
{ "_id" : ObjectId("592f838dd276944818f7edb7"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 3 }
{ "_id" : ObjectId("592f8964d276944818f7eddf"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 3 }
{ "_id" : ObjectId("592f838dd276944818f7edb8"), "name" : "linux", "object" : "SA", "company" : "docker", "phone" : 4 }
{ "_id" : ObjectId("592f8964d276944818f7ede0"), "name" : "MongoDB", "object" : "redis", "company" : "winner", "phone" : 4 }
skip        MySQL   limit      。

ここではクエリーに する を しますが、データベースではクエリーが に な なので、 の も く、 で の に しても をまとめ けます.