Oksana Oksana - 10 months ago 71
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