0
[ "_id" : ObjectId("59d1f4d0539f772aacf90f61"), 
    "user_id" : 1222.0, 
    "user_name" : "jadenn", 
    "email" : "jdkdkdjjjjjjjjjjjjjjjjjjjh@j.com", 
    "phone" : 333333333.0, 
    "image_ref" : "static/image/123IMG_20170917_232813.jpg", 
    "stories" : [
        {
            "title" : "accident", 
            "description" : "kjsbskns", 
            "longitude" : 19.2, 
            "latitude" : 81.4, 
            "location" : "isl", 
            "date" : 12.0, 
            "reactions" : [
                {
                    "type" : "seen", 
                    "date" : "1234", 
                    "user_id" : 123.0
                }, 
                {
                    "type" : "seen", 
                    "date" : "1234", 
                    "user_id" : 123.0
                }
            ], 
            "comments" : [
                {
                    "comment" : "djksnjknfkjguye", 
                    "date" : 123.0, 
                    "user_id" : 123.0
                }, 
                {
                    "comment" : "this is the accident case ", 
                    "date" : 123.0, 
                    "user_id" : 123.0
                }
            ], 
            "reports" : [
                {
                    "description" : "uye", 
                    "date" : 123.0, 
                    "user_id" : 1232321.0
                }
            ], 
            "catagory_name" : [
                {
                    "type" : "uye"
                }
            ]
        }
    ]
}

Here is my document I want a query which will return only list of stories. Not a complete document of user. I searched but could not find the solution. Every solution return complete document by applying "Where condition as MYSQL"]1

Khushhal
  • 91
  • 1
  • 8

1 Answers1

0

You need to project on stories key from your document as below:

db.youCollection.find({}, {stories:1, _id:0}) 
Atish
  • 4,277
  • 2
  • 24
  • 32