2
0
mirror of https://github.com/frappe/books.git synced 2024-12-26 12:28:12 +00:00
books/docs/models/metadata.md
2018-02-08 17:58:51 +05:30

12 lines
349 B
Markdown

# Metadata
Metadata are first class objects in Frappe.js. You can get a metadata object by `frappe.getMeta`. All objects from the `models` folders of all modules are loaded.
### Example
```js
let todo_meta = frappe.getMeta('ToDo');
// get all fields of type "Data"
let data_fields = todo_meta.fields.map(d => d.fieldtype=='Data' ? d : null);
```