@@ -258,16 +258,21 @@ schema builder method in your application.
258
258
You can also use the following methods to return more information about the
259
259
collection fields:
260
260
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
265
265
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
267
271
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 represents
273
+ the ``_id`` field name in a MongoDB collection as the alias ``id`` in
274
+ the returned list of field names. You can pass either ``_id`` or
275
+ ``id`` to the ``hasColumn()`` and ``hasColumns()`` methods.
271
276
272
277
Example
273
278
```````
0 commit comments