aggregation-framework

    1熱度

    1回答

    剛剛開始mongo並開始有問題了。我有一個叫做「externalTransaction」收集和我想寫這個MySQL查詢的等價: select transactionCode, sum(amount) as totalSum, count(amount) as totalCount from externalTransaction where transactioncod

    4熱度

    2回答

    我使用MongoDB的2.1以及如何將這個查詢轉化爲PHP db.counter.aggregate([ { $match:{ page_id:123456 }}, { $group:{_id:"$page_id",total:{$sum:"$pageview"}} } ]); 感謝

    26熱度

    1回答

    我想用MongoDB的聚合框架在SQL運行哪些看起來有點像: SELECT SUM(A), B, C from myTable GROUP BY B, C; 的文檔狀態: 您可以在管線中的文件指定一個單場,以前計算的值,或由幾個傳入字段組成的聚合密鑰。 但是目前還不清楚'幾個傳入字段構成的聚合密鑰實際上是什麼? 我的數據集是有點像這樣: [{ "timeStamp" : 13418349886

    14熱度

    3回答

    MongoDB有一個新的Aggregation Framework,我想弄清楚如何在Mongoid中使用它。看起來有一個摩托車的分支與這個功能討論here。我已經更新到MongoDB的2.2,並試圖在我的應用程序安裝輕便摩托車的這個分支這樣的: 寶石「輕便摩托車」,混帳:「混帳://github.com/mongoid/moped.git」,分支: 'aggregation-support' 但聚

    1熱度

    1回答

    蒙戈DB - 數據的聚合(MongoDB中2.1.0 - 不穩定的版本): db.test.save({serverName:'abc123', info:[12,43,23,10]}); db.test.save({serverName:'abc123', info:[12,22,19,11]}); db.test.aggregate({$group:{_id:"$serverName"

    8熱度

    2回答

    在我的MongoDB藏書我有結構如下文件: /* 0 */ { "_id" : ObjectId("50485b89b30f1ea69110ff4c"), "publisher" : { "$ref" : "boohya", "$id" : "foo" }, "displayName" : "Paris Nightlife",

    0熱度

    1回答

    我試圖使用pymongo和蒙戈的聚合框架和這裏就是我在Python有: OperationFailure: command SON([('aggregate', 'call_log'), ('pipeline', [{'$match': {u'user': 1}}, {'$project': {'date': 1, 'status': 1, 'number': 1, 'description':

    3熱度

    1回答

    我試圖從php使用新的mongodb聚合框架。 我使用的mongod v2.2中,PHP 5.3.13,和MongoDB PECL庫v1.3.0beta2上OSX山獅 我跌跌撞撞就在門口...... 我「已經採取的從PHP文檔頁面的例子之一,並把它砍下來...... $m = new Mongo; $c = $m->selectDB("test")->selectCollection("zips

    0熱度

    2回答

    我需要按_id和國家進行分組。我設法按_id分組,但想知道如何將這些_id s中的國家進行分組,並返回每個國家/地區的計數。 我正在使用聚合框架。到現在爲止還挺好。 conn = Mongo::Connection.new db = conn['foobar_development'] cmd = { aggregate: 'live_daily_stats', pipe

    2熱度

    2回答

    如何使用mongdoDb聚集 select count(*) as ccount from a group by a.someField order by ccount desc limit 1 在mondoDb使用組功能,我希望將我的收藏通過特定的按鍵來寫simial查詢並返回1行,這往往低於 代碼發生在Java中,返回列表,這是由字段someField應用組,並返回元素的集合,其中每個元素