Welcome Guest, Not a member yet? Register   Sign In
please help me, What does the equivalent in mongoDB to return an array which contains the field name?
#1

[eluser]zacksyah[/eluser]
mysql function in Codeigniter I Use list_field() to return an array containing the field names. What does the equivalent in mongoDB to return an array which contains he field name? This code below I use the list_field function
Code:
function GetField($execution) {
    $query = $this->db->query($execution);
    if ($query->num_rows() > 0) {
        return $query->list_fields();
    } else {
        return array();
    }
}
My goal is if there is input with complex queries, the field appears dynamically in accordance with the input query like using phpmyadmin in MySQL & rockmongo in mongoDB.
If there is no equivalent query in MongoDB, Is there a trick to solve my problem?
thanks in advance




Theme © iAndrew 2016 - Forum software by © MyBB