0

I can't create a rails query with mongoid equivalent to a mongo query.

school.student{"sigae.valid_username.username": { $exists: true}}

How can I convert this query to use in Rails with MongoId?

Davi Luis
  • 396
  • 3
  • 16
  • I'm not familiar with Mongold, but these might help: https://docs.mongodb.com/mongoid/current/tutorials/mongoid-queries/ https://stackoverflow.com/questions/12999368/mongoid-or-query-syntax You could try some of the syntax there, you might be able to call .any? on the result (not sure) – Allison Sep 26 '19 at 03:12
  • What have you tried so far, and what was the result? – D. SM Sep 26 '19 at 18:37
  • Add the mongoid documents definitions. It will help with understanding your model structure. – Udi Cohen Oct 03 '19 at 18:47

0 Answers0