Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "53a6e02221360e263e000000": {
- "_id": {
- "$id": "53a6e02221360e263e000000"
- },
- "title": "1"
- },
- "53a6e02221360e263e000001": {
- "_id": {
- "$id": "53a6e02221360e263e000001"
- },
- "title": "2"
- }
- }
- [
- {
- "id": "53a6e02221360e263e000000",
- "title": "1"
- },
- {
- "id": "53a6e02221360e263e000001",
- "title": "2"
- }
- ]
- // MongoDB init before it
- $cursor = $mongo->db->collection->find();
- // For not large data
- $result = iterator_to_array( $cursor );
- $json = json_encode($result);
- var_dump($json);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement