문서 메뉴
문서 홈
/
MongoDB 매뉴얼
/

문서 쿼리

이 페이지의 내용

  • 컬렉션에서 모든 문서 선택
  • 동등성 조건 지정
  • 쿼리 연산자를 사용하여 조건 지정
  • AND 조건 지정
  • OR 조건 지정
  • ANDOR 조건 지정
  • MongoDB Atlas로 문서 쿼리
  • 추가 쿼리 튜토리얼
  • 행동
  • 추가 메서드 및 옵션

문서를 쿼리하려면 반환하려는 문서를 나타내는 쿼리 조건 자를 지정합니다. 빈 쿼리 조건자({ })를 지정하면 쿼리는 컬렉션의 모든 문서를 반환합니다.

다음 메서드를 사용하여 MongoDB에서 문서를 쿼리할 수 있습니다:

  • 프로그래밍 언어의 드라이버입니다.

  • MongoDB Atlas UI. 자세한 내용 은 MongoDB Atlas로 문서 쿼리 를 참조하세요.

  • MongoDB Compass


오른쪽 상단의 언어 선택 드롭다운 메뉴를 사용하여 다음 예제의 언어를 설정하거나 MongoDB Compass를 선택합니다.


이 페이지는 mongosh에서 db.collection.find() 메서드를 사용해 쿼리 작업을 실행하는 예시를 설명합니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지는 MongoDB Compass를 사용해 쿼리 작업을 실행하는 예시를 설명합니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 mongoc_collection_find_with_opts를 사용하는 쿼리 작업의 예를 제공합니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지는 MongoDB C# 드라이버에서 MongoCollection.Find() 메서드를 사용해 쿼리 작업을 실행하는 예시를 설명합니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 Collection.Find 를 사용한 쿼리 작업의 예를 제공합니다. MongoDB Go 드라이버 의 함수 .

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 MongoDB Java Reactive Streams 드라이버에서 com.mongodb.reactivestreams.client.MongoCollection.find 메서드를 사용하여 쿼리 작업의 예시를 보여줍니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 MongoDB Java Synchronous 드라이버에서 com.mongodb.client.MongoCollection.find 메서드를 사용하여 쿼리 작업의 예시를 보여줍니다.

드라이버는 com.mongodb.client.model.Filters 를 제공합니다. 필터 문서를 쉽게 만들 수 있는 헬퍼 메서드. 이 페이지의 예제에서는 이러한 메서드를 사용하여 필터 문서를 만듭니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 MongoCollection.find() MongoDB Kotlin 코루틴 드라이버의 메서드입니다.

드라이버는 com.mongodb.client.model.Filters 를 제공합니다. 필터 문서를 쉽게 만들 수 있는 헬퍼 메서드. 이 페이지의 예제에서는 이러한 메서드를 사용하여 필터 문서를 만듭니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 를 사용한 motor.motor_asyncio.AsyncIOMotorCollection.find 쿼리 작업의 예를 제공합니다. 모터 의 메서드 드라이버.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지는 MongoDB Node.js 드라이버에서 Collection.find() 메서드를 사용해 쿼리 작업을 실행하는 예시를 설명합니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 MongoDB::Collection::find() MongoDB 펄(Perl) 드라이버 의 메서드.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 MongoDB PHP 라이브러리에서 MongoDB\\Collection::find() 메서드를 사용하여 쿼리 작업의 예시를 보여줍니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 pymongo.collection.Collection.find 를 사용한 쿼리 작업의 예를 제공합니다. 메서드 를 제공합니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 MongoDB Ruby 드라이버에서 Mongo::Collection#find() 메서드를 사용하여 쿼리 작업의 예시를 보여줍니다.

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

이 페이지에서는 collection.find() 메서드를 사용하는 쿼리 작업의 예를 제공합니다.MongoDB 스칼라 드라이버 의 메서드 .

이 페이지의 예제에서는 inventory 컬렉션을 사용합니다. MongoDB 인스턴스의 테스트 데이터베이스에 연결한 다음 inventory 컬렉션을 만듭니다:

db.inventory.insertMany([
{ item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" },
{ item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "A" },
{ item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" },
{ item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" },
{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }
]);
[
{ "item": "journal", "qty": 25, "size": { "h": 14, "w": 21, "uom": "cm" }, "status": "A" },
{ "item": "notebook", "qty": 50, "size": { "h": 8.5, "w": 11, "uom": "in" }, "status": "A" },
{ "item": "paper", "qty": 100, "size": { "h": 8.5, "w": 11, "uom": "in" }, "status": "D" },
{ "item": "planner", "qty": 75, "size": { "h": 22.85, "w": 30, "uom": "cm" }, "status": "D" },
{ "item": "postcard", "qty": 45, "size": { "h": 10, "w": 15.25, "uom": "cm" }, "status": "A" }
]

MongoDB Compass에서 문서를 삽입하는 방법은 문서 삽입하기를 참조하세요.

mongoc_collection_t *collection;
mongoc_bulk_operation_t *bulk;
bson_t *doc;
bool r;
bson_error_t error;
bson_t reply;
collection = mongoc_database_get_collection (db, "inventory");
bulk = mongoc_collection_create_bulk_operation_with_opts (collection, NULL);
doc = BCON_NEW (
"item", BCON_UTF8 ("journal"),
"qty", BCON_INT64 (25),
"size", "{",
"h", BCON_DOUBLE (14),
"w", BCON_DOUBLE (21),
"uom", BCON_UTF8 ("cm"),
"}",
"status", BCON_UTF8 ("A"));
r = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &error);
bson_destroy (doc);
if (!r) {
MONGOC_ERROR ("%s\n", error.message);
goto done;
}
doc = BCON_NEW (
"item", BCON_UTF8 ("notebook"),
"qty", BCON_INT64 (50),
"size", "{",
"h", BCON_DOUBLE (8.5),
"w", BCON_DOUBLE (11),
"uom", BCON_UTF8 ("in"),
"}",
"status", BCON_UTF8 ("A"));
r = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &error);
bson_destroy (doc);
if (!r) {
MONGOC_ERROR ("%s\n", error.message);
goto done;
}
doc = BCON_NEW (
"item", BCON_UTF8 ("paper"),
"qty", BCON_INT64 (100),
"size", "{",
"h", BCON_DOUBLE (8.5),
"w", BCON_DOUBLE (11),
"uom", BCON_UTF8 ("in"),
"}",
"status", BCON_UTF8 ("D"));
r = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &error);
bson_destroy (doc);
if (!r) {
MONGOC_ERROR ("%s\n", error.message);
goto done;
}
doc = BCON_NEW (
"item", BCON_UTF8 ("planner"),
"qty", BCON_INT64 (75),
"size", "{",
"h", BCON_DOUBLE (22.85),
"w", BCON_DOUBLE (30),
"uom", BCON_UTF8 ("cm"),
"}",
"status", BCON_UTF8 ("D"));
r = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &error);
bson_destroy (doc);
if (!r) {
MONGOC_ERROR ("%s\n", error.message);
goto done;
}
doc = BCON_NEW (
"item", BCON_UTF8 ("postcard"),
"qty", BCON_INT64 (45),
"size", "{",
"h", BCON_DOUBLE (10),
"w", BCON_DOUBLE (15.25),
"uom", BCON_UTF8 ("cm"),
"}",
"status", BCON_UTF8 ("A"));
r = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &error);
bson_destroy (doc);
if (!r) {
MONGOC_ERROR ("%s\n", error.message);
goto done;
}
/* "reply" is initialized on success or error */
r = (bool) mongoc_bulk_operation_execute (bulk, &reply, &error);
if (!r) {
MONGOC_ERROR ("%s\n", error.message);
}
var documents = new BsonDocument[]
{
new BsonDocument
{
{ "item", "journal" },
{ "qty", 25 },
{ "size", new BsonDocument { { "h", 14 }, { "w", 21 }, { "uom", "cm"} } },
{ "status", "A" }
},
new BsonDocument
{
{ "item", "notebook" },
{ "qty", 50 },
{ "size", new BsonDocument { { "h", 8.5 }, { "w", 11 }, { "uom", "in"} } },
{ "status", "A" }
},
new BsonDocument
{
{ "item", "paper" },
{ "qty", 100 },
{ "size", new BsonDocument { { "h", 8.5 }, { "w", 11 }, { "uom", "in"} } },
{ "status", "D" }
},
new BsonDocument
{
{ "item", "planner" },
{ "qty", 75 },
{ "size", new BsonDocument { { "h", 22.85 }, { "w", 30 }, { "uom", "cm"} } },
{ "status", "D" }
},
new BsonDocument
{
{ "item", "postcard" },
{ "qty", 45 },
{ "size", new BsonDocument { { "h", 10 }, { "w", 15.25 }, { "uom", "cm"} } },
{ "status", "A" }
},
};
collection.InsertMany(documents);
docs := []interface{}{
bson.D{
{"item", "journal"},
{"qty", 25},
{"size", bson.D{
{"h", 14},
{"w", 21},
{"uom", "cm"},
}},
{"status", "A"},
},
bson.D{
{"item", "notebook"},
{"qty", 50},
{"size", bson.D{
{"h", 8.5},
{"w", 11},
{"uom", "in"},
}},
{"status", "A"},
},
bson.D{
{"item", "paper"},
{"qty", 100},
{"size", bson.D{
{"h", 8.5},
{"w", 11},
{"uom", "in"},
}},
{"status", "D"},
},
bson.D{
{"item", "planner"},
{"qty", 75},
{"size", bson.D{
{"h", 22.85},
{"w", 30},
{"uom", "cm"},
}},
{"status", "D"},
},
bson.D{
{"item", "postcard"},
{"qty", 45},
{"size", bson.D{
{"h", 10},
{"w", 15.25},
{"uom", "cm"},
}},
{"status", "A"},
},
}
result, err := coll.InsertMany(context.TODO(), docs)
Publisher<Success> insertManyPublisher = collection.insertMany(asList(
Document.parse("{ item: 'journal', qty: 25, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }"),
Document.parse("{ item: 'notebook', qty: 50, size: { h: 8.5, w: 11, uom: 'in' }, status: 'A' }"),
Document.parse("{ item: 'paper', qty: 100, size: { h: 8.5, w: 11, uom: 'in' }, status: 'D' }"),
Document.parse("{ item: 'planner', qty: 75, size: { h: 22.85, w: 30, uom: 'cm' }, status: 'D' }"),
Document.parse("{ item: 'postcard', qty: 45, size: { h: 10, w: 15.25, uom: 'cm' }, status: 'A' }")
));
collection.insertMany(asList(
Document.parse("{ item: 'journal', qty: 25, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }"),
Document.parse("{ item: 'notebook', qty: 50, size: { h: 8.5, w: 11, uom: 'in' }, status: 'A' }"),
Document.parse("{ item: 'paper', qty: 100, size: { h: 8.5, w: 11, uom: 'in' }, status: 'D' }"),
Document.parse("{ item: 'planner', qty: 75, size: { h: 22.85, w: 30, uom: 'cm' }, status: 'D' }"),
Document.parse("{ item: 'postcard', qty: 45, size: { h: 10, w: 15.25, uom: 'cm' }, status: 'A' }")
));
collection.insertMany(
listOf(
Document("item", "journal")
.append("qty", 25)
.append("size", Document("h", 14)
.append("w", 21)
.append("uom", "cm")
)
.append("status", "A"),
Document("item", "notebook")
.append("qty", 50)
.append("size", Document("h", 8.5)
.append("w", 11)
.append("uom", "in")
)
.append("status", "A"),
Document("item", "paper")
.append("qty", 100)
.append("size", Document("h", 8.5)
.append("w", 11)
.append("uom", "in")
)
.append("status", "D"),
Document("item", "planner")
.append("qty", 75)
.append("size", Document("h", 22.85)
.append("w", 30)
.append("uom", "cm")
)
.append("status", "D"),
Document("item", "postcard")
.append("qty", 45)
.append("size", Document("h", 10)
.append("w", 15.25)
.append("uom", "cm")
)
.append("status", "A"),
)
)
await db.inventory.insert_many(
[
{
"item": "journal",
"qty": 25,
"size": {"h": 14, "w": 21, "uom": "cm"},
"status": "A",
},
{
"item": "notebook",
"qty": 50,
"size": {"h": 8.5, "w": 11, "uom": "in"},
"status": "A",
},
{
"item": "paper",
"qty": 100,
"size": {"h": 8.5, "w": 11, "uom": "in"},
"status": "D",
},
{
"item": "planner",
"qty": 75,
"size": {"h": 22.85, "w": 30, "uom": "cm"},
"status": "D",
},
{
"item": "postcard",
"qty": 45,
"size": {"h": 10, "w": 15.25, "uom": "cm"},
"status": "A",
},
]
)
await db.collection('inventory').insertMany([
{
item: 'journal',
qty: 25,
size: { h: 14, w: 21, uom: 'cm' },
status: 'A'
},
{
item: 'notebook',
qty: 50,
size: { h: 8.5, w: 11, uom: 'in' },
status: 'A'
},
{
item: 'paper',
qty: 100,
size: { h: 8.5, w: 11, uom: 'in' },
status: 'D'
},
{
item: 'planner',
qty: 75,
size: { h: 22.85, w: 30, uom: 'cm' },
status: 'D'
},
{
item: 'postcard',
qty: 45,
size: { h: 10, w: 15.25, uom: 'cm' },
status: 'A'
}
]);
$db->coll("inventory")->insert_many(
[
{
item => "journal",
qty => 25,
size => { h => 14, w => 21, uom => "cm" },
status => "A"
},
{
item => "notebook",
qty => 50,
size => { h => 8.5, w => 11, uom => "in" },
status => "A"
},
{
item => "paper",
qty => 100,
size => { h => 8.5, w => 11, uom => "in" },
status => "D"
},
{
item => "planner",
qty => 75,
size => { h => 22.85, w => 30, uom => "cm" },
status => "D"
},
{
item => "postcard",
qty => 45,
size => { h => 10, w => 15.25, uom => "cm" },
status => "A"
}
]
);
$insertManyResult = $db->inventory->insertMany([
[
'item' => 'journal',
'qty' => 25,
'size' => ['h' => 14, 'w' => 21, 'uom' => 'cm'],
'status' => 'A',
],
[
'item' => 'notebook',
'qty' => 50,
'size' => ['h' => 8.5, 'w' => 11, 'uom' => 'in'],
'status' => 'A',
],
[
'item' => 'paper',
'qty' => 100,
'size' => ['h' => 8.5, 'w' => 11, 'uom' => 'in'],
'status' => 'D',
],
[
'item' => 'planner',
'qty' => 75,
'size' => ['h' => 22.85, 'w' => 30, 'uom' => 'cm'],
'status' => 'D',
],
[
'item' => 'postcard',
'qty' => 45,
'size' => ['h' => 10, 'w' => 15.25, 'uom' => 'cm'],
'status' => 'A',
],
]);
db.inventory.insert_many(
[
{
"item": "journal",
"qty": 25,
"size": {"h": 14, "w": 21, "uom": "cm"},
"status": "A",
},
{
"item": "notebook",
"qty": 50,
"size": {"h": 8.5, "w": 11, "uom": "in"},
"status": "A",
},
{
"item": "paper",
"qty": 100,
"size": {"h": 8.5, "w": 11, "uom": "in"},
"status": "D",
},
{
"item": "planner",
"qty": 75,
"size": {"h": 22.85, "w": 30, "uom": "cm"},
"status": "D",
},
{
"item": "postcard",
"qty": 45,
"size": {"h": 10, "w": 15.25, "uom": "cm"},
"status": "A",
},
]
)
client[:inventory].insert_many([{ item: 'journal',
qty: 25,
size: { h: 14, w: 21, uom: 'cm' },
status: 'A' },
{ item: 'notebook',
qty: 50,
size: { h: 8.5, w: 11, uom: 'in' },
status: 'A' },
{ item: 'paper',
qty: 100,
size: { h: 8.5, w: 11, uom: 'in' },
status: 'D' },
{ item: 'planner',
qty: 75,
size: { h: 22.85, w: 30, uom: 'cm' },
status: 'D' },
{ item: 'postcard',
qty: 45,
size: { h: 10, w: 15.25, uom: 'cm' },
status: 'A' }
])
collection.insertMany(Seq(
Document("""{ item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" }"""),
Document("""{ item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "A" }"""),
Document("""{ item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" }"""),
Document("""{ item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" }"""),
Document("""{ item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }""")
)).execute()

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 빈 문서를 쿼리 필터 매개 변수로 쿼리 표시줄에 전달합니다. 쿼리 필터 매개 변수는 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

컬렉션의 모든 문서를 선택하려면 find 메서드에 빈 문서를 쿼리 필터 매개변수로 전달합니다. 쿼리 필터 매개변수가 선택 기준을 결정합니다.

db.inventory.find( {} )
Compass 컬렉션의 모든 문서 선택
mongoc_collection_t *collection;
bson_t *filter;
mongoc_cursor_t *cursor;
collection = mongoc_database_get_collection (db, "inventory");
filter = BCON_NEW (NULL);
cursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);

다음 메서드를 적절히 호출하여 열려 있는 리소스도 정리해야 합니다.

var filter = Builders<BsonDocument>.Filter.Empty;
var result = collection.Find(filter).ToList();
cursor, err := coll.Find(
context.TODO(),
bson.D{},
)
FindPublisher<Document> findPublisher = collection.find(new Document());
FindIterable<Document> findIterable = collection.find(new Document());
val flowInsertMany = collection
.find(empty())
cursor = db.inventory.find({})
const cursor = db.collection('inventory').find({});
$cursor = $db->coll("inventory")->find( {} );
$cursor = $db->inventory->find([]);
cursor = db.inventory.find({})
client[:inventory].find({})
var findObservable = collection.find(Document())

이 작업은 다음 SQL 문에 해당하는 {} 쿼리 조건자를 사용합니다.

SELECT * FROM inventory

메서드 구문에 대한 자세한 내용은 find()를 참조하세요.

MongoDB Compass 쿼리 표시줄에 대한 자세한 내용은 쿼리 표시줄을 참조하세요 .

메서드 구문에 대한 자세한 내용은 mongoc_collection_find_with_opts를 참조하세요.

메서드 구문에 관한 자세한 내용은 Find()를 참조하세요.

메서드 구문에 대한 자세한 내용은 com.mongodb.reactivestreams.client.MongoCollection.find 를 참조하세요. .

메서드 구문에 대한 자세한 내용은 com.mongodb.client.MongoCollection.find를 참조하세요.

메서드 구문에 대한 자세한 내용은 MongoCollection.find()를 참조하세요.

find() 메서드에서 지원되는 옵션은 find()를 참조하세요.

메서드 구문에 대한 자세한 내용은 find()를 참조하세요.

메서드 구문에 대한 자세한 내용은 find() 를 참조하세요.

메서드 구문에 대한 자세한 내용은 를 find 참조하세요.

메서드 구문에 대한 자세한 내용은 find()를 참조하세요.

메서드 구문에 대한 자세한 내용은 collection.find()을 참조하세요.

동일성 조건을 지정하려면 쿼리 필터 문서에서 <field>:<value> 표현식을 사용하세요.

{ <field1>: <value1>, ... }

동일성 조건을 지정하려면 쿼리 필터 문서에서 <field>:<value> 표현식을 사용하세요.

{ <field1>: <value1>, ... }

동일성 조건을 지정하려면 쿼리 필터 문서에서 <field>:<value> 표현식을 사용하세요.

{ <field1>: <value1>, ... }

동등 조건을 지정하려면 Eq 를 사용하여 필터를 구성합니다. 메서드:

Builders<BsonDocument>.Filter.Eq(<field>, <value>);

동등 조건을 지정하려면 com.mongodb.client.model.Filters.eq 메서드를 사용하여 쿼리 필터 문서를 만듭니다.

and(eq(<field1>, <value1>), eq(<field2>, <value2>) ...)

동일성 조건을 지정하려면 com.mongodb.client.model.Filters.eq_ 메서드를 사용하여 쿼리 필터 문서를 만듭니다.

and(eq(<field1>, <value1>), eq(<field2>, <value2>) ...)

동등 조건을 지정하려면 Filters.eq() 메서드를 사용하여 쿼리 필터 문서를 만듭니다.

and(eq(<field1>, <value1>), eq(<field2>, <value2>) ...)

동일성 조건을 지정하려면 쿼리 필터 문서에서 <field>:<value> 표현식을 사용하세요.

{ <field1>: <value1>, ... }

동일성 조건을 지정하려면 쿼리 필터 문서에서 <field>:<value> 표현식을 사용하세요.

{ <field1>: <value1>, ... }

동일성 조건을 지정하려면 쿼리 필터 문서에서 <field> => <value> 표현식을 사용하세요.

{ <field1> => <value1>, ... }

동일성 조건을 지정하려면 쿼리 필터 문서에서 <field> => <value> 표현식을 사용하세요.

[ <field1> => <value1>, ... ]

동일성 조건을 지정하려면 쿼리 필터 문서에서 <field>:<value> 표현식을 사용하세요.

{ <field1>: <value1>, ... }

동일성 조건을 지정하려면 쿼리 필터 문서에서 <field> => <value> 표현식을 사용하세요.

{ <field1> => <value1>, ... }

동일성 조건을 지정하려면 com.mongodb.client.model.Filters.eq_ 메서드를 사용하여 쿼리 필터 문서를 만듭니다.

and(equal(<field1>, <value1>), equal(<field2>, <value2>) ...)

다음 예시에서는 inventory 컬렉션에서 status"D"와 동일한 모든 문서를 선택합니다.

db.inventory.find( { status: "D" } )

다음 필터를 Compass 쿼리 표시줄에 복사하고 Find 을(를) 클릭합니다.

{ status: "D" }
mongoc_collection_t *collection;
bson_t *filter;
mongoc_cursor_t *cursor;
collection = mongoc_database_get_collection (db, "inventory");
filter = BCON_NEW ("status", BCON_UTF8 ("D"));
cursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);
var filter = Builders<BsonDocument>.Filter.Eq("status", "D");
var result = collection.Find(filter).ToList();
cursor, err := coll.Find(
context.TODO(),
bson.D{{"status", "D"}},
)
findPublisher = collection.find(eq("status", "D"));
findIterable = collection.find(eq("status", "D"));
val findFlow = collection
.find(eq("status", "D"))
cursor = db.inventory.find({"status": "D"})
const cursor = db.collection('inventory').find({ status: 'D' });
$cursor = $db->coll("inventory")->find( { status => "D" } );
$cursor = $db->inventory->find(['status' => 'D']);
cursor = db.inventory.find({"status": "D"})
client[:inventory].find(status: 'D')
findObservable = collection.find(equal("status", "D"))

이 작업은 다음 SQL 문에 해당하는 { status: "D" } 쿼리 조건자를 사용합니다.

SELECT * FROM inventory WHERE status = "D"

참고

MongoDB Compass 쿼리 표시줄은 포함된 하위 문서의 키를 포함하여 collection 문서에 있는 키를 기반으로 현재 쿼리를 자동 완성합니다.

쿼리 필터 문서에서는 쿼리 연산자를 사용하여 다음 형식의 조건을 지정할 수 있습니다.

{ <field1>: { <operator1>: <value1> }, ... }

쿼리 필터 문서에서는 쿼리 연산자를 사용하여 다음 형식의 조건을 지정할 수 있습니다.

{ <field1>: { <operator1>: <value1> }, ... }

쿼리 필터 문서에서는 쿼리 연산자를 사용하여 다음 형식의 조건을 지정할 수 있습니다.

{ <field1>: { <operator1>: <value1> }, ... }

MongoDB는 동등 필터 외에도 필터 조건을 지정하는 다양한 쿼리 연산자 를 제공합니다.FilterDefinitionBuilder 사용 메서드를 사용하여 필터 문서를 만듭니다. 예를 들면 다음과 같습니다.

var builder = Builders<BsonDocument>.Filter;
builder.And(builder.Eq(<field1>, <value1>), builder.Lt(<field2>, <value2>));

MongoDB는 동등 조건 외에도 필터 조건을 지정하는 다양한 쿼리 연산자 를 제공합니다. com.mongodb.client.model.Filters 필터 문서를 쉽게 만들 수 있는 헬퍼 메서드. 예를 들면 다음과 같습니다.

and(gte(<field1>, <value1>), lt(<field2>, <value2>), eq(<field3>, <value3>))

MongoDB는 동등 조건 외에도 필터 조건을 지정하는 다양한 쿼리 연산자 를 제공합니다. com.mongodb.client.model.Filters 필터 문서를 쉽게 만들 수 있는 헬퍼 메서드. 예를 들면 다음과 같습니다.

and(gte(<field1>, <value1>), lt(<field2>, <value2>), eq(<field3>, <value3>))

MongoDB는 동등 조건 외에도 필터 조건을 지정하는 다양한 쿼리 연산자 를 제공합니다. com.mongodb.client.model.Filters 필터 문서를 쉽게 만들 수 있는 헬퍼 메서드. 예를 들면 다음과 같습니다.

and(gte(<field1>, <value1>), lt(<field2>, <value2>), eq(<field3>, <value3>))

쿼리 필터 문서에서는 쿼리 연산자를 사용하여 다음 형식의 조건을 지정할 수 있습니다.

{ <field1>: { <operator1>: <value1> }, ... }

쿼리 필터 문서에서는 쿼리 연산자를 사용하여 다음 형식의 조건을 지정할 수 있습니다.

{ <field1>: { <operator1>: <value1> }, ... }

쿼리 필터 문서에서는 쿼리 연산자를 사용하여 다음 형식의 조건을 지정할 수 있습니다.

{ <field1> => { <operator1> => <value1> }, ... }

쿼리 필터 문서에서는 쿼리 연산자를 사용하여 다음 형식의 조건을 지정할 수 있습니다.

[ <field1> => [ <operator1> => <value1> ], ... ]

쿼리 필터 문서에서는 쿼리 연산자를 사용하여 다음 형식의 조건을 지정할 수 있습니다.

{ <field1>: { <operator1>: <value1> }, ... }

쿼리 필터 문서에서는 쿼리 연산자를 사용하여 다음 형식의 조건을 지정할 수 있습니다.

{ <field1> => { <operator1> => <value1> }, ... }

MongoDB는 동등 조건 외에도 필터 조건을 지정하는 다양한 쿼리 연산자 를 제공합니다. com.mongodb.client.model.Filters_ 헬퍼 메서드를 사용하여 필터 문서를 쉽게 만들 수 있습니다. 예를 들면 다음과 같습니다.

and(gte(<field1>, <value1>), lt(<field2>, <value2>), equal(<field3>, <value3>))

다음 예시에서는 inventory 컬렉션에서 status"A""D"와 동일한 모든 문서를 조회합니다.

db.inventory.find( { status: { $in: [ "A", "D" ] } } )

다음 필터를 Compass 쿼리 표시줄에 복사하고 Find를 클릭합니다.

{ status: { $in: [ "A", "D" ] } }
mongoc_collection_t *collection;
bson_t *filter;
mongoc_cursor_t *cursor;
collection = mongoc_database_get_collection (db, "inventory");
filter = BCON_NEW (
"status", "{",
"$in", "[",
BCON_UTF8 ("A"), BCON_UTF8 ("D"),
"]",
"}");
cursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);
var filter = Builders<BsonDocument>.Filter.In("status", new[] { "A", "D" });
var result = collection.Find(filter).ToList();
cursor, err := coll.Find(
context.TODO(),
bson.D{{"status", bson.D{{"$in", bson.A{"A", "D"}}}}})
findPublisher = collection.find(in("status", "A", "D"));
findIterable = collection.find(in("status", "A", "D"));
val findFlow = collection
.find(`in`("status", "A", "D"))
cursor = db.inventory.find({"status": {"$in": ["A", "D"]}})
const cursor = db.collection('inventory').find({
status: { $in: ['A', 'D'] }
});
$cursor = $db->coll("inventory")->find( { status => { '$in' => [ "A", "D" ] } } );
$cursor = $db->inventory->find(['status' => ['$in' => ['A', 'D']]]);
cursor = db.inventory.find({"status": {"$in": ["A", "D"]}})
client[:inventory].find(status: { '$in' => [ 'A', 'D' ]})
findObservable = collection.find(in("status", "A", "D"))

참고

$or 연산자를 사용하여 이 쿼리를 표현할 수 있지만, 동일한 필드에 동등성 검사를 수행할 때에는 $or 연산자 대신 $in 연산자를 사용합니다.

이 작업은 다음 SQL 문에 해당하는 { status: { $in: [ "A", "D" ] } } 쿼리 조건자를 사용합니다.

SELECT * FROM inventory WHERE status in ("A", "D")

MongoDB 쿼리 연산자의 전체 목록은 쿼리 및 프로젝션 연산자 문서에서 확인 가능합니다.

복합 쿼리는 컬렉션의 문서에 포함된 하나 이상의 필드에 조건을 지정할 수 있습니다. 암시적으로, 논리 접속사 AND는 복합 쿼리의 절을 연결하여 쿼리가 컬렉션에서 모든 조건에 일치하는 문서를 선택하도록 합니다.

다음 예시에서는 inventory 컬렉션에서 status"A"같고 qty가 ($lt)30보다 작은 문서를 모두 조회합니다.

db.inventory.find( { status: "A", qty: { $lt: 30 } } )

다음 필터를 Compass 쿼리 표시줄에 복사하고 Find를 클릭합니다.

{ status: "A", qty: { $lt: 30 } }
mongoc_collection_t *collection;
bson_t *filter;
mongoc_cursor_t *cursor;
collection = mongoc_database_get_collection (db, "inventory");
filter = BCON_NEW (
"status", BCON_UTF8 ("A"),
"qty", "{",
"$lt", BCON_INT64 (30),
"}");
cursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);
var builder = Builders<BsonDocument>.Filter;
var filter = builder.And(builder.Eq("status", "A"), builder.Lt("qty", 30));
var result = collection.Find(filter).ToList();
cursor, err := coll.Find(
context.TODO(),
bson.D{
{"status", "A"},
{"qty", bson.D{{"$lt", 30}}},
})
findPublisher = collection.find(and(eq("status", "A"), lt("qty", 30)));
findIterable = collection.find(and(eq("status", "A"), lt("qty", 30)));
val findFlow = collection
.find(and(eq("status", "A"), lt("qty", 30)))
cursor = db.inventory.find({"status": "A", "qty": {"$lt": 30}})
const cursor = db.collection('inventory').find({
status: 'A',
qty: { $lt: 30 }
});
$cursor = $db->coll("inventory")->find( { status => "A", qty => { '$lt' => 30 } } );
$cursor = $db->inventory->find([
'status' => 'A',
'qty' => ['$lt' => 30],
]);
cursor = db.inventory.find({"status": "A", "qty": {"$lt": 30}})
client[:inventory].find(status: 'A', qty: { '$lt' => 30 })
findObservable = collection.find(and(equal("status", "A"), lt("qty", 30)))

이 작업은 다음 SQL 문에 해당하는 { status: "A", qty: { $lt: 30 } } 쿼리 조건자를 사용합니다.

SELECT * FROM inventory WHERE status = "A" AND qty < 30

다른 MongoDB 비교 연산자는 비교 연산자에서 확인 가능합니다.

$or 연산자를 사용하면 논리 접속사 OR로 각 절을 연결하는 복합 쿼리를 지정하여 쿼리는 컬렉션에서 적어도 하나의 조건과 일치하는 문서를 선택합니다.

다음 예시에서는 컬렉션에서 status"A"와 같거나 qty($lt)30보다 작은 모든 문서를 검색합니다.

db.inventory.find( { $or: [ { status: "A" }, { qty: { $lt: 30 } } ] } )

다음 필터를 Compass 쿼리 표시줄에 복사하고 Find를 클릭합니다.

{ $or: [ { status: "A" }, { qty: { $lt: 30 } } ] }
mongoc_collection_t *collection;
bson_t *filter;
mongoc_cursor_t *cursor;
collection = mongoc_database_get_collection (db, "inventory");
filter = BCON_NEW (
"$or", "[",
"{",
"status", BCON_UTF8 ("A"),
"}","{",
"qty", "{",
"$lt", BCON_INT64 (30),
"}",
"}",
"]");
cursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);
var builder = Builders<BsonDocument>.Filter;
var filter = builder.Or(builder.Eq("status", "A"), builder.Lt("qty", 30));
var result = collection.Find(filter).ToList();
cursor, err := coll.Find(
context.TODO(),
bson.D{
{"$or",
bson.A{
bson.D{{"status", "A"}},
bson.D{{"qty", bson.D{{"$lt", 30}}}},
}},
})
findPublisher = collection.find(or(eq("status", "A"), lt("qty", 30)));
findIterable = collection.find(or(eq("status", "A"), lt("qty", 30)));
val findFlow = collection
.find(or(eq("status", "A"), lt("qty", 30)))
cursor = db.inventory.find({"$or": [{"status": "A"}, {"qty": {"$lt": 30}}]})
const cursor = db.collection('inventory').find({
$or: [{ status: 'A' }, { qty: { $lt: 30 } }]
});
$cursor = $db->coll("inventory")->find(
{ '$or' => [ { status => "A" }, { qty => { '$lt' => 30 } } ] }
);
$cursor = $db->inventory->find([
'$or' => [
['status' => 'A'],
['qty' => ['$lt' => 30]],
],
]);
cursor = db.inventory.find({"$or": [{"status": "A"}, {"qty": {"$lt": 30}}]})
client[:inventory].find('$or' => [{ status: 'A' },
{ qty: { '$lt' => 30 } }
])
findObservable = collection.find(or(equal("status", "A"), lt("qty", 30)))

이 작업은 다음 SQL 문에 해당하는 { $or: [ { status: 'A' }, { qty: { $lt: 30 } } ] } 쿼리 조건자를 사용합니다.

SELECT * FROM inventory WHERE status = "A" OR qty < 30

참고

비교 연산자를 사용하는 쿼리에는 유형 괄호가 적용됩니다.

다음 예제에서 복합 쿼리 문서는 status"A"같고 qty가 ($lt) 30보다 작거나 또는 item이(가) p로 시작하는 조건 중 하나를 만족하는 모든 문서를 선택합니다.

db.inventory.find( {
status: "A",
$or: [ { qty: { $lt: 30 } }, { item: /^p/ } ]
} )

다음 필터를 Compass 쿼리 표시줄에 복사하고 Find를 클릭합니다.

{ status: "A", $or: [ { qty: { $lt: 30 } }, { item: /^p/ } ] }
mongoc_collection_t *collection;
bson_t *filter;
mongoc_cursor_t *cursor;
collection = mongoc_database_get_collection (db, "inventory");
filter = BCON_NEW (
"status", BCON_UTF8 ("A"),
"$or", "[",
"{",
"qty", "{",
"$lt", BCON_INT64 (30),
"}",
"}","{",
"item", BCON_REGEX ("^p", ""),
"}",
"]");
cursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);
var builder = Builders<BsonDocument>.Filter;
var filter = builder.And(
builder.Eq("status", "A"),
builder.Or(builder.Lt("qty", 30), builder.Regex("item", new BsonRegularExpression("^p"))));
var result = collection.Find(filter).ToList();
cursor, err := coll.Find(
context.TODO(),
bson.D{
{"status", "A"},
{"$or", bson.A{
bson.D{{"qty", bson.D{{"$lt", 30}}}},
bson.D{{"item", bson.Regex{Pattern: "^p", Options: ""}}},
}},
})
findPublisher = collection.find(
and(eq("status", "A"),
or(lt("qty", 30), regex("item", "^p")))
);
findIterable = collection.find(
and(eq("status", "A"),
or(lt("qty", 30), regex("item", "^p")))
);
val findFlow = collection
.find(
and(eq("status", "A"),
or(lt("qty", 30), regex("item", "^p")))
)
cursor = db.inventory.find(
{"status": "A", "$or": [{"qty": {"$lt": 30}}, {"item": {"$regex": "^p"}}]}
)
const cursor = db.collection('inventory').find({
status: 'A',
$or: [{ qty: { $lt: 30 } }, { item: { $regex: '^p' } }]
});
$cursor = $db->coll("inventory")->find(
{
status => "A",
'$or' => [ { qty => { '$lt' => 30 } }, { item => { '$regex' => "^p" } } ]
}
);
$cursor = $db->inventory->find([
'status' => 'A',
'$or' => [
['qty' => ['$lt' => 30]],
// Alternatively: ['item' => new \MongoDB\BSON\Regex('^p')]
['item' => ['$regex' => '^p']],
],
]);
cursor = db.inventory.find(
{"status": "A", "$or": [{"qty": {"$lt": 30}}, {"item": {"$regex": "^p"}}]}
)
client[:inventory].find(status: 'A',
'$or' => [{ qty: { '$lt' => 30 } },
{ item: { '$regex' => BSON::Regexp::Raw.new('^p') } }
])
findObservable = collection.find(and(
equal("status", "A"),
or(lt("qty", 30), regex("item", "^p")))
)

이 작업은 다음과 같은 쿼리 조건자를 사용합니다.

{
status: 'A',
$or: [
{ qty: { $lt: 30 } }, { item: { $regex: '^p' } }
]
}

는 다음 SQL 문에 해당합니다.

SELECT * FROM inventory WHERE status = "A" AND ( qty < 30 OR item LIKE "p%")

참고

MongoDB는 문자열 패턴 일치를 수행하기 위해 정규 표현식 $regex 쿼리를 지원합니다.

이 섹션의 예에서는 샘플 영화 데이터세트를 사용합니다. MongoDB Atlas 배포서버에 샘플 데이터세트를 로드하는 방법을 알아보려면 샘플 데이터 로드를 참조하세요.

MongoDB Atlas의 쿼리에서 반환할 필드를 프로젝트하려면 다음 단계를 따르세요.

1
  1. 이미 표시되어 있지 않은 경우 탐색 모음의 Organizations 메뉴에서 원하는 프로젝트가 포함된 조직을 선택합니다.

  2. 아직 표시되지 않은 경우 내비게이션 바의 Projects 메뉴에서 프로젝트를 선택합니다.

  3. Clusters 페이지가 아직 표시되지 않은 경우 사이드바에서 Database를 클릭합니다.

    클러스터 페이지가 표시됩니다.

2
  1. 샘플 데이터가 포함된 클러스터의 경우 Browse Collections 을 클릭합니다.

  2. 왼쪽 탐색 창에서 sample_mflix 데이터베이스를 선택합니다.

  3. movies 컬렉션을 선택합니다.

3

Filter 필드에 쿼리 필터 문서를 지정합니다. 쿼리 필터 문서는 쿼리 연산자를 사용하여 검색 조건을 지정합니다.

다음 쿼리 필터 문서를 Filter 검색 바에 복사합니다.

{ year: 1924 }
4

이 쿼리 필터는 sample_mflix.movies 컬렉션에서 year 필드가 1924와 일치하는 모든 문서를 반환합니다.

추가 쿼리 예시는 아래에서 확인 가능합니다.

db.collection.find() 메서드는 일치하는 문서에 커서를 반환합니다.

MongoDB Compass Find 작업은 찾기 쿼리를 기반으로 컬렉션의 일치하는 문서에 대한 커서를 엽니다.

MongoDB Compass 샘플링에 관한 자세한 내용은 Compass FAQ를 참조하세요.

mongoc_collection_find 메서드는 일치하는 문서에 커서 를 반환합니다.

MongoCollection.Find() 메서드는 일치하는 문서에 커서 를 반환합니다. 커서 반복에 대해서는 MongoDB C# 드라이버 설명서를 참조하세요.

Collection.Find 함수는 커서 를 반환합니다. 일치하는 문서에 추가합니다.커서 보기 자세한 내용은 설명서를 참조하세요.

MongoCollection.find() 메서드는 FindFlow 의 인스턴스를 반환합니다. 클래스.

Collection.find() 메서드는 커서를 반환합니다.

MongoDB::Collection::find() 메서드는 일치하는 문서에 커서 를 반환합니다. 커서 반복에대해서는 MongoDB 펄(Perl) 드라이버 설명서를 참조하세요.

pymongo.collection.Collection.find 메서드는 일치하는 문서에 커서 를 반환합니다. 커서 반복에대해서는 PyMongo 설명서를 참조하세요.

Mongo::Collection#find() 메서드는 EnumerableCollectionView를 반환합니다. 커서는 예를 들어 #to_a() 또는 #each()을(를) 호출하여 View이(가) 열거될 때 생성됩니다. View에서 #to_enum()을(를) 호출하여 Enumerator을(를) 받을 수도 있습니다. 커서 반복에 대해서는 Ruby 드라이버 API 문서를 참조하세요.

collection.find() 메서드는 관찰 가능 찾기를 반환합니다. .

복제본 세트 및 복제본 세트 샤드에 대한 읽기의 경우, 클라이언트는 읽기 고려를 통해 읽기에 대한 격리 수준을 선택할 수 있습니다. 자세한 내용은 Read Concern을 참조하십시오.

MongoDB 드라이버 또는 mongosh를 사용하여 찾기 작업을 실행하면 이 명령은 쿼리 결과를 관리하는 커서를 반환합니다. 쿼리 결과는 문서 배열로 반환되지 않습니다.

커서에서 문서를 반복하는 방법을 알아보려면 해당 드라이버의 설명서를 참조하세요. mongosh를 사용하는 경우 mongosh에서 커서 반복하기를 참조하세요.

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

참고

db.collection.findOne() 메서드는 제한이 1 인 db.collection.find() 메서드와 동일한 작업을 수행합니다.

filter 외에도 MongoDB Compass를 사용하면 다음 옵션을 쿼리 표시줄에 전달할 수 있습니다.

결과 데이터에서 반환할 필드를 지정합니다.
반환된 문서의 정렬 순서를 지정합니다.
결과 집합을 반환하기 전에 건너뛸 문서의 개수를 지정합니다.
반환할 문서의 최대 개수를 지정합니다.

다음 메서드는 컬렉션에서 문서를 읽을 수도 있습니다.

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

참고

MongoCollection.FindOne() 메서드는 MongoCollection.Find() 와 동일한 작업을 1 수행합니다. 제한이 있는 메서드입니다.

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

다음과 같은 방법으로도 컬렉션에서 문서를 읽을 수 있습니다.

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

참고

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

참고

MongoDB::Collection::find_one() 메서드는 MongoDB::Collection::find() 과 동일한 작업을 1 수행합니다. 제한이 있는 메서드입니다.

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

참고

MongoDB\\Collection::findOne() 메서드는 1 제한이 있는 MongoDB\\Collection::find() 메서드와 동일한 작업을 수행합니다.

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

참고

메서드는 과 동일한 pymongo.collection.Collection.find_one 작업을 pymongo.collection.Collection.find 1수행합니다. 제한이 있는 메서드입니다.

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

다음 항목도 컬렉션의 문서를 읽을 수 있습니다.

돌아가기

방법

다음

포함된 문서