Closed zapatista closed 12 years ago
class Application_Model_Db_Table_Post extends Shanty_Mongo_Document { protected static $_db = 'holemp'; protected static $_collection = 'user'; }
$user = Application_Model_Db_Table_Post::all();
why not work on me ?
output: Shanty_Mongo_Iterator_Cursor Object ( [_cursor:protected] => MongoCursor Object ( )
[_config:protected] => Array ( [connectionGroup] => default [db] => holemp [collection] => user [documentClass] => Application_Model_Db_Table_Post [documentSetClass] => Shanty_Mongo_DocumentSet )
)
You know all returns a DocumentSet not a Document? You need to iterate over it to get the individual documents.
Tom is correct. You need to iterate over the cursor to fetch the documents from the database.
class Application_Model_Db_Table_Post extends Shanty_Mongo_Document { protected static $_db = 'holemp'; protected static $_collection = 'user'; }
$user = Application_Model_Db_Table_Post::all();
why not work on me ?
output: Shanty_Mongo_Iterator_Cursor Object ( [_cursor:protected] => MongoCursor Object ( )
)