Answer the question
In order to leave comments, you need to log in
How to get only one mongodb field in fat-free framework?
Help me please. Is it possible in some unknown way to get only one (or several) fields from MongoDB, and not all at once? Or is it so arranged that it returns the entire document? It's just extra data, and if I only need the 'pashash' value, it's stupid to load the entire object.
In SQL analogue: SELECT `passhash` FROM ... I did not find an example
in the documentation .
The data is loaded like this:
$db=new DB\Mongo('mongodb://localhost:27017','testdb');
$user=new DB\Mongo\Mapper($db,'users');
$user->load(array('login'=>'admin')); // подозреваю что при вызове грузится весь документ
echo $user->passhash; // выведет значение поля passhash
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question