mongoid

    0熱度

    2回答

    每個用戶都有一個地址。 class User include Mongoid::Document has_one :address end class Address include Mongoid::Document belongs_to :user field :street_name, type:String end u =

    0熱度

    1回答

    升級到MongoID 5我得到這個錯誤後未定義的方法`[]' 爲# 的代碼如下所示: result = ::Presentation::Interaction.collection.aggregate( [ user_match_criterias_live(conference), ::Presentation::ReportGenerator::DELCOUNTRY

    0熱度

    1回答

    我試圖連接到由Heroku的MLAB託管的MongoDB實例,但它只是不斷與迴應: '驗證':未授權查詢.lotto_results(13)' 這是沒有意義的,因爲用戶帳戶具有dbOwner角色,這意味着它應該能夠讀取和寫入。 我發現關於如何heroku的性質(如何重新啓動)somthing可能會導致問題,但它似乎並沒有解釋如何解決它(我想給這個鏈接,但我似乎無法找到網頁,這是一個谷歌線程,我認爲

    0熱度

    2回答

    我想從查詢mongoid中將值分配給變量,只要計數優於特定值。 ,如果我做 mdl = Mdl.by_params(params) unless Mdl.by_params(params) < limit 查詢被執行了兩次,我該怎麼做檢查,並與一個查詢分配?

    0熱度

    1回答

    在我的控制器中,我有* _params來允許屬性。無論如何,即使事情確實發生了變化,.changed始終是空白的。是否有新的Rails 5方法來檢測更改的屬性? # case_params is the basic rails controller permission method if @case.update(case_params) puts @case.changed.co

    1熱度

    1回答

    我正在使用ruby on rails作爲我的API與mongoid。假設我有兩個模型: class Human field: salary, type: Integer has_many: dogs end class Dog field: name, type: String belongs_to: human end 我想要獲取人類在查詢所有

    0熱度

    1回答

    我有用戶和帖子之間的關聯,因爲用戶有很多帖子。 我的查詢如User.includes(:posts).all。我想寫到哪條件的職位,但我得到了錯誤無效包括 User.includes(:posts,with: -> (posts) {where(post.likes > 100)} include Mongoid::Document

    0熱度

    1回答

    問題:在使用MongoDB中查詢排序,並告訴我使用allowDiskUse:true選項查詢 我的記憶是越來越超出。但在mongoid軌道中,聚合函數沒有傳遞任何選項。 我得到的錯誤: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation.

    0熱度

    1回答

    在我的應用程序中,我使用rails 4.2.4,它有activemodel 4.2.4和mongoid 5.1.3。現在我想將我的mongoid版本升級到6.0.0。正式they mention here它需要active model 5.0.0。有什麼方法可以升級mongoid?提前致謝。

    0熱度

    1回答

    我使用Ahoy與Mongoid商店。任何意見非常感謝! 我的問題是,爲了提高效率,每次創建一個新的ahoy事件時,我都想更新該元素計數,以便我可以執行諸如通過瀏覽量進行排序等操作。我的計劃是在每次生成事件時使用類似after_create的mongoid回調來更新計數器。像這樣: class Ahoy::Event after_create :update_pageviews