GithubHelp home page GithubHelp logo

nian88 / codeigniter-mongo-library Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intekhabrizvi/codeigniter-mongo-library

0.0 2.0 0.0 375 KB

MongoDB Library for Codeigniter with advance features like aggregation, journal, write concern and query profiling

Home Page: http://intekhabrizvi.github.io

PHP 100.00%

codeigniter-mongo-library's Introduction

Build Status

CIMongo - MongoDB Library for Codeigniter (Legacy)

For PHP7+, Codeigniter3+ and mongodb-1.5-x php extension support, use the latest library available at https://github.com/intekhabrizvi/codeigniter-mongodb-library

We tried to make transition as easy as possible by keeping all functions name as is. In most cases new library would be a drop-in replacement for this library, if not please open a bug request in new library.

This library help you to use perform MongoDB based queries just like active record in CodeIgniter.

This library support

  • Write Concern and Journal
  • Read Preference
  • Aggregation Framework
  • Query Profiling

Wiki and how-to can be found here http://intekhabrizvi.github.io/mongodb-library-for-codeigniter.html

For Code Unitesting use branch named unitesting

Methods

Insert Method

  • insert Insert a new document into a collection
  • batch_insert Insert multiple new documents into a collection

Select Method

  • select Get select fields from returned documents
  • where OR get_where Where section of the query
  • where_in Where something is in an array of something
  • where_in_all Where something is in all of an array of * something
  • where_not_in Where something is not in array of something
  • where_or Where something is based on or
  • where_gt Where something is greater than something
  • where_gte Where something is greater than or equal to something
  • where_lt Where something is less than something
  • where_lte Where something is less than or equal to something
  • where_between Where something is in between to something
  • where_between_ne Where something is in between and but not equal to something
  • where_ne Where something is not equal to something
  • like Where something is search by like query
  • order_by Order the results
  • limit OR offset Limit the number of returned results
  • count Document Count based on where query
  • distinct Retrieve a list of distinct values for the given key across a single collection
  • find_one Retrieve single document from collection

Update Method

  • set Sets a field to a value
  • unset_field Unsets a field
  • addtoset Adds a value to an array if doesn't exist
  • push Pushes a value into an array field
  • pop Pops a value from an array field
  • pull Removes an array by the value of a field
  • rename_field Rename a field
  • inc Increments the value of a field
  • mul Multiple the value of a field
  • max Updates the value of the field to a specified value if the specified value is greater than the current value of the field
  • min Updates the value of the field to a specified value if the specified value is less than the current value of the field.
  • update Update a single document in a collection
  • update_all Update all documents in a collection

Delete Method

  • delete Delete a single document in a collection
  • delete_all Delete all documents in a collection

Aggregation Method

  • aggregate Perform aggregation query on document

Profiling Methods

  • output_benchmark return complete explain data for all the find based query performed

Index Method

  • add_index Create a new index on collection
  • remove_index Remove index from collection
  • list_indexes Show all index created on collections

DB Method

  • switch_db Switch to a different database
  • drop_db Drops a database
  • drop_collection Drops a collection
  • command Perform MongoDB command

Extra Helper

  • date Create or convert date to MongoDB based Date

License

Creative Commons Attribution 3.0 License. Codes are provided AS IS basis, i am not responsible for anything.

codeigniter-mongo-library's People

Contributors

intekhabrizvi avatar bryant1410 avatar zeevgl avatar

Watchers

James Cloos avatar Azhar nian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.