Answer the question
In order to leave comments, you need to log in
Finding a document by value in an array - Mongoid/Sinatra
There is a document in Monge:
{
"_id": ObjectId("53638084e1054e706f000001"),
"name": "Vasya",
"order": [
"burger",
"nuggets",
"mtdew"
],
}
get '/order/:order' do
@clients = Client.where(order: [':order'])
haml :index
end
Answer the question
In order to leave comments, you need to log in
get '/order/:order' do
@clients = Client.where(order: params[:order])
haml :index
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question