Skip to content

Commit 49e44a0

Browse files
committed
DOCSP-43806: getColumns id alias
1 parent 7a865e7 commit 49e44a0

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

docs/fundamentals/database-collection.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,21 @@ schema builder method in your application.
258258
You can also use the following methods to return more information about the
259259
collection fields:
260260

261-
- ``Schema::hasColumn(string $<collection>, string $<field name>)``: checks if the specified field exists
262-
in at least one document
263-
- ``Schema::hasColumns(string $<collection>, string[] $<field names>)``: checks if each specified field exists
264-
in at least one document
261+
- ``Schema::hasColumn(string $<collection>, string $<field name>)``:
262+
checks if the specified field exists in at least one document
263+
- ``Schema::hasColumns(string $<collection>, string[] $<field names>)``:
264+
checks if each specified field exists in at least one document
265265

266-
.. note::
266+
MongoDB is a schemaless database, so the preceding methods query the collection
267+
data rather than the database schema. If the specified collection doesn't exist
268+
or is empty, these methods return a value of ``false``.
269+
270+
.. note:: id Alias
267271

268-
MongoDB is a schemaless database, so the preceding methods query the collection
269-
data rather than the database schema. If the specified collection doesn't exist
270-
or is empty, these methods return a value of ``false``.
272+
Starting in {+odm-long+} v5.1, the ``getColumns()`` method returns
273+
the ``_id`` field name as the alias ``id``. You can pass either
274+
``_id`` or ``id`` to the ``hasColumn()`` and ``hasColumns()``
275+
methods.
271276

272277
Example
273278
```````

0 commit comments

Comments
 (0)