period lose properties of document while the property is temporary add for update

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.0.5
    • Component/s: Admin
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I have a document named of job,the as collection name is also job,the another collection named with autoSelectedJob,the data is read from job and save to by springdata on Every 5 minutes,so the autoSelectedJob collection data is all the same with job,

      I have a temporary function that need add a top property,this time the job class
      has not the top property,so i do some thing follow:

      one:login in we mongodb server,exec the command of "db.job.update({},{$set:{"top":0}},false,true)",

      two:modify job class add the top property and get set method

      three:redeploy the new application

      did after all this, We found The following strange problems:

      the top property in collection of autoSelectedJob is period lose,some time exist in autoSelectedJob,some time is not exist while the task run three ,but all other properties of job is all exist,we mongo is a repset,i looked at primary

      the data is follow:

      set01:PRIMARY> db.autoSelectedJob.find({},{"top":1,"title":1}).sort({"top":-1}).limit(10)
      { "_id" : ObjectId("55d2a5f40cf2144809db4a7d"), "title" : "社区运营总监", "top" : 10 }
      { "_id" : ObjectId("561c6c230cf27f1039543f7a"), "title" : "web前端开发工程师", "top" : 9 }
      { "_id" : ObjectId("56446d9f0cf2baa0b8cbe975"), "title" : "系统架构师", "top" : 8 }
      { "_id" : ObjectId("562730000cf2c09b73614739"), "title" : "java资深开发工程师", "top" : 7 }
      { "_id" : ObjectId("561b4b410cf2945255c8ae69"), "title" : "JAVA技术经理", "top" : 6 }
      { "_id" : ObjectId("5626ff5c0cf2c09b73614523"), "title" : "web前端", "top" : 5 }
      { "_id" : ObjectId("561dc3760cf2de45c4ba7639"), "title" : "Java技术专家/架构师", "top" : 4 }
      { "_id" : ObjectId("56400fe20cf2dffa0f816bda"), "title" : "产品专家(APP方向)", "top" : 3 }
      { "_id" : ObjectId("56397ba90cf2c826abc4edfb"), "title" : "高级java工程师", "top" : 2 }
      { "_id" : ObjectId("563083d30cf261dd15cd7fd5"), "title" : "数据分析师", "top" : 1 }
      

      after run three the task,the top property is not exist :

      set01:PRIMARY> db.autoSelectedJob.find({},{"top":1,"title":1}).sort({"top":-1}).limit(10)
      { "_id" : ObjectId("55d56b9e0cf286511f9c9442"), "title" : "APP产品运营总监" }
      { "_id" : ObjectId("5608b64a0cf2092800de9cc9"), "title" : "ASP.NET软件工程师 " }
      { "_id" : ObjectId("55fb826e0cf2092800de9723"), "title" : "平台运营总监" }
      { "_id" : ObjectId("55a7178ae4b052832a2d7503"), "title" : "PHP网站架构师" }
      { "_id" : ObjectId("55c2feb60cf21ef6d0736585"), "title" : "产品经理" }
      { "_id" : ObjectId("55c955b70cf21ef6d07368bf"), "title" : "产品经理" }
      { "_id" : ObjectId("55b0c9650b745626e3bcf0be"), "title" : "资深原画师-场景方向" }
      { "_id" : ObjectId("55c1ad4de4b09e276d2daac2"), "title" : "Android资深开发工程师" }
      { "_id" : ObjectId("55c96776e4b09e276d2dafb2"), "title" : "系统架构师" }
      { "_id" : ObjectId("55c9bde5e4b0d1135ef4e27e"), "title" : "html5前端研发工程师" }
      

      after run three the task,the top property is again exist:

      set01:PRIMARY> db.autoSelectedJob.find({},{"top":1,"title":1}).sort({"top":-1}).limit(10)
      { "_id" : ObjectId("55d2a5f40cf2144809db4a7d"), "title" : "社区运营总监", "top" : 10 }
      { "_id" : ObjectId("561c6c230cf27f1039543f7a"), "title" : "web前端开发工程师", "top" : 9 }
      { "_id" : ObjectId("56446d9f0cf2baa0b8cbe975"), "title" : "系统架构师", "top" : 8 }
      { "_id" : ObjectId("562730000cf2c09b73614739"), "title" : "java资深开发工程师", "top" : 7 }
      { "_id" : ObjectId("561b4b410cf2945255c8ae69"), "title" : "JAVA技术经理", "top" : 6 }
      { "_id" : ObjectId("5626ff5c0cf2c09b73614523"), "title" : "web前端", "top" : 5 }
      { "_id" : ObjectId("561dc3760cf2de45c4ba7639"), "title" : "Java技术专家/架构师", "top" : 4 }
      { "_id" : ObjectId("56400fe20cf2dffa0f816bda"), "title" : "产品专家(APP方向)", "top" : 3 }
      { "_id" : ObjectId("56397ba90cf2c826abc4edfb"), "title" : "高级java工程师", "top" : 2 }
      { "_id" : ObjectId("563083d30cf261dd15cd7fd5"), "title" : "数据分析师", "top" : 1 }
      

            Assignee:
            Kelsey Schubert
            Reporter:
            pengrongxin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: