Oksana Oksana - 1 year ago 75
Ruby Question

How get all column names of model in Mongoid

How can I get all column names from a

Mongoid
model in Rails?

Answer Source

Use

Model.fields.keys

Replace Model with your model name