Oksana Oksana - 9 days ago 6
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

Use

Model.fields.keys

Replace Model with your model name