2017-01-13 70 views
0

我有一個名爲學校收集和文檔中是這樣的:Mongo:文檔中的字段數是否會影響查詢性能?

{ 
    "_id" : 0, 
    "_class" : "com.aixueniao.server.model.School", 
    "companyUserId" : 0, 
    "schoolUserId" : 0, 
    "schoolName" : "校區名稱", 
    "showSchoolName" : 0, 
    "gradeIds" : "[]", 
    "firstLevelSubjectIds" : "[]", 
    "secondLevelSubjectIds" : "[]", 
    "classType" : "", 
    "introduction" : "校區介紹", 
    "mainImageId" : 0, 
    "imageIds" : "[]", 
    "longitude" : 0.0, 
    "latitude" : 0.0, 
    "locationId" : 0, 
    "address" : "校區地址", 
    "runningTime" : 0.0, 
    "teacherCount" : 0, 
    "telephone" : "", 
    "fixedPhone" : "", 
    "createTime" : "2017-01-13 01:16:54", 
    "expirationTime" : "2017-01-13 01:16:54", 
    "schoolStatus" : "ARREARS", 
    "authorizationStatus" : "NO", 
    "rejectReason" : "無" 
} 

有文檔中的約26場,並字段的數量會影響查詢性能?我會查詢4個字段,並使用$ near查詢。提前致謝。

回答

0

簡單的答案是肯定的,這就是爲什麼蒙戈爲我們提供了類似的功能projections由不具有數據庫,以獲得更好的性能文檔中返回的所有字段

相關問題