我们如何在doctrine-mongo odm中更改结果键名称。我只想将“ id:Application \ Document \ Page:private ”更改为“ id ”
var d = new Date();
window.onload = function dateDisplay(){
document.getElementById("dateDisplay").innerHTML = d;
}
();
(function (){
document.getElementById("dateDisplay").style.color="red";
})();
答案 0 :(得分:0)
是的,我们可以使用->hydrate(false)
createQueryBuilder
$user = $this->dm->createQueryBuilder('Application\Document\User')
->field('username')->equals($username)
->field('status')->equals('active');
->hydrate(false)
->select(array('username', 'status','guid','device_token'))
->getQuery()
->execute()
->toArray();