2015-11-12 35 views
2

該版本是一個對象。我如何才能得到這個對象內的名字。 一般一個版本看起來是這樣的:如何獲得拉力賽中「發佈」的「名稱」?

"Release": { 
    "ObjectID": 12345, 
    "Name": "2014 Q3", 
    "StartDate": "2014-07-01 18:00:00.0", 
    "ReleaseDate": "2014-10-01 16:59:59.0" 
} 

我如何得到的只是「名稱」?

這裏是我的代碼:

_getStoreForopenDefect: function() { 
    return { 
     find: { 
      _TypeHierarchy: { '$in' : [ 'Defect' ] }, 
      Children: null, 
      _ProjectHierarchy: this.getContext().getProject().ObjectID, 
      _ValidFrom: {'$gt': Rally.util.DateTime.toIsoString(Rally.util.DateTime.add(new Date(), 'day', -120)) }, 
      State: "Open", 
      Release: "8.0" <<<<<<<<<< Right is where I want to pass the release 
     }, 
     fetch: ['Severity','Release','Project'], 
     hydrate: ['Severity','Release','Project'], 
     sort: { 
      _ValidFrom: 1 
     }, 
     context: this.getContext().getDataContext(), 
     limit: Infinity 
    }; 
} 

我想在上面的代碼搶發行,並通過它來「釋放」我的「查找」下,讓自己的搜索收窄。

回答

1

它看起來像你使用的是回溯api。發佈將需要由其對象ID在你找到對象中指定:

Release: 12345 

或者,如果你有在範圍上多個項目,那麼你就需要查詢具有相同名稱的類似版本和日期,然後指定全部爲:

Release: {'$in': [12345, 23456, 34567]} 
相關問題