We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8f7bf77 + 6c5dff2 commit 7172a24Copy full SHA for 7172a24
docs/query-builder.txt
@@ -46,6 +46,19 @@ The following example shows the syntax of a query builder call:
46
DB::collection('<collection name>')
47
// chain methods by using the "->" object operator
48
->get();
49
+.. tip::
50
+
51
+ Before using the ``DB::collection()`` method, ensure that you specify MongoDB as your application's
52
+ default database connection. For instructions on setting the database connection,
53
+ see the :ref:`laravel-quick-start-connect-to-mongodb` step in the Quick Start.
54
55
+ If MongoDB is not your application's default database, you can use the ``DB::connection()`` method
56
+ to specify a MongoDB connection. Pass the name of the connection to the ``connection()`` method,
57
+ as shown in the following code:
58
59
+ .. code-block:: php
60
61
+ $connection = DB::connection('mongodb');
62
63
This guide provides examples of the following types of query builder operations:
64
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments