Oksana Oksana - 8 months ago 60
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