I'm having a problem with MogoDB ODM Incubator.
When a Model class was already used to find records it uses the source collection correctly. But if I use the class again, then the source changes to [model name]_model.
Like this:
$country = CountriesModel::findFirst([["name"=>['$eq'=>"country name"]]]);
In the MongoDB profiler I see this:
{
"op" : "query",
"ns" : "entregueme.countries",
"query" : {
"find" : "countries",
"filter" : {
"name" : {
"$eq" : "Brasil"
}
}
},
Which is right, because the source is countries for that model.
But on the second time it changes the model source to:
$country = CountriesModel::findFirst([["name"=>['$eq'=>"country name"]]]);
And then the MongoDB profiler I see this:
{
"op" : "query",
"ns" : "entregueme.countries_model",
"query" : {
"find" : "countries_model",
"filter" : {
"name" : {
"$eq" : "Brasil"
}
}
},
So, it somehow changes the model source to something close to the model class name.
Anyone knows why?