Ruby on Rails is well-integrated with MongoDB, the Gem pack:
Address:https://rubygems.org/gems/mongoid
Documentation: https://docs.mongodb.com/ecosystem/tutorial/ruby-mongoid-tutorial/#ruby-mongoid-tutorial
Latest queries that are also used
Model.where (name:/abc/)
This can look up all the contents of the Name field in the model table with ABC.
Pagination, can be combined with willpage
defSelf.paginate (options ={}) options[:p age]=options[:p age].to_i options[:p Age]= 1ifoptions[:p Age] = =0 Options=base_options Options:: Willpaginate::collection.create (options[:p age], options[:p er_page])|pager|Items_count= Options[:total_entries] | |self.count fill_pager_with Self.skip (Options[:offset]). Limit (options[:p er_page]), items_count, pager end end defself.base_options (options) options[:p Age]|| = 1options[:p Er_page]|| = 20Options[:offset]= (options[:p age].to_i-1) *options[:p er_page].to_i options EnddefSelf.fill_pager_with (medias, size, pager) pager.replace medias.to_a pager.total_entries=Size End
Rails Query MongoDB General Query