我把mongo放在我的Mac上使用複製mongo.so 5.2和5.4 mongoCollection沒有聚合方法! 我測試了同樣的php在我的aws上,並在那裏工作致命的錯誤:調用未定義的函數聚合()
我試過var_dump(get_class_methods('MongoCollection'))
; 和我的地方:
array (size=24)
0 => string '__construct' (length=11)
1 => string '__toString' (length=10)
2 => string '__get' (length=5)
3 => string 'getName' (length=7)
4 => string 'getSlaveOkay' (length=12)
5 => string 'setSlaveOkay' (length=12)
6 => string 'drop' (length=4)
7 => string 'validate' (length=8)
8 => string 'insert' (length=6)
9 => string 'batchInsert' (length=11)
10 => string 'update' (length=6)
11 => string 'remove' (length=6)
12 => string 'find' (length=4)
13 => string 'findOne' (length=7)
14 => string 'ensureIndex' (length=11)
15 => string 'deleteIndex' (length=11)
16 => string 'deleteIndexes' (length=13)
17 => string 'getIndexInfo' (length=12)
18 => string 'count' (length=5)
19 => string 'save' (length=4)
20 => string 'createDBRef' (length=11)
21 => string 'getDBRef' (length=8)
22 => string 'group' (length=5)
23 => string 'distinct' (length=8)`
和AWS:
array(28) { [0]=> string(11) "__construct" [1]=> string(10) "__toString" [2]=> string(5) "__get" [3]=> string(7) "getName" [4]=> string(12) "getSlaveOkay" [5]=> string(12) "setSlaveOkay" [6]=> string(17) "getReadPreference" [7]=> string(17) "setReadPreference" [8]=> string(4) "drop" [9]=> string(8) "validate" [10]=> string(6) "insert" [11]=> string(11) "batchInsert" [12]=> string(6) "update" [13]=> string(6) "remove" [14]=> string(4) "find" [15]=> string(7) "findOne" [16]=> string(13) "findAndModify" [17]=> string(11) "ensureIndex" [18]=> string(11) "deleteIndex" [19]=> string(13) "deleteIndexes" [20]=> string(12) "getIndexInfo" [21]=> string(5) "count" [22]=> string(4) "save" [23]=> string(11) "createDBRef" [24]=> string(8) "getDBRef" [25]=> string(5) "group" [26]=> string(8) "distinct" [27]=> string(9) "aggregate" }
當我使用終端(本地)骨料它的工作原理
似乎很奇怪,任何想法表示讚賞。
我想這是關於mongo.so不蒙戈安裝本身 – zarehb 2013-03-10 08:33:19
我想我也可以用命令http://stackoverflow.com/questions/11290809/mongodb-aggregation-php住現在 – zarehb 2013-03-10 08:34:35
升級pecl mongo以匹配服務器上使用的版本將是一個更合乎邏輯的結論 – AD7six 2013-03-10 09:10:33