Это много вопросов
Из результата Мангуст у меня есть несколько предметов, которые я получаю через result.length
.
Как я могу получить конкретные предметы, например,
Person.find({'exployment.office':'Greenway'})
.exec(function(err, result){
//from the result, how can i get those items with
result.length would give me the number of items in the result
but how can i get a specific item without having to use loop to get
the specific item within the result
//There are like fifty people in the result,
//how can i get the number of items in result
});
В SQL у меня есть такой запрос
select *
from table1, table2
where table2.field2 = value1
and table2.field2 = table1.field2
and table1.value1 = value3
1012 *, например *
select *
from city, state
where state.name = 'xxy'
and state.id = city.state_id
and city.name != 'yyy'
Как это можно преобразовать в мангуста?
В SQL, если я хочу выбрать людей, чье имя, например, Смит, королева, я могу использовать такие вещи, как
select *
from table
where first_name in (Smith, Queen)
Это даст мне результат для людей, чьи имена совпадают с SMith и Queen
Как я могу сделать это в мангусте?