Skip to content

Miscellaneous

primaryKeys()

primaryKeys() — returns any

Alias for primaryKey(). Use this for better readability when you’re accessing multiple primary keys.

NameTypeRequiredDefaultDescription
positionnumericyes0If you are accessing a composite primary key, pass the position of a single key to fetch.
primaryKeys([ position ]) <!--- Get a list of the names of the primary keys in the table mapped to the `employee` model (which is the `employees` table by default) --->
<cfset keyNames = model("employee").primaryKeys()>