aodto/mongoqb 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aodto/mongoqb

最新稳定版本:1.3.1

Composer 安装命令:

composer require aodto/mongoqb

包简介

Mongo Query Builder

README 文档

README

Install via Packagist and Composer

Add the following into your composer.json file:

{
	"require": {
		"aodto/mongoqb": "*"
	}
}

Then run

composer install

Install via Git

git clone git://git@github.com:aodto/MongoQB

Download a zip/tarball

Download the latest version:

(Note the zip/tarball won't include any unit tests or composer files)

Unit tests

Master branch Build Status

Develop branch Build Status

The library currently has 100% unit test coverage. To run the unit test suite make sure you have MongoDB installed locally and running with no authentication and on the default port - 27017.

Then run:

composer update --dev
cd vendor/aodto/mongoqb
phpunit -c tests/phpunit.xml

Example usage

Connect to the database

$qb = \MongoQB\Builder(array(
	'dsn'	=>	'mongodb://user:pass@localhost:27017/databaseName'
);

Insert a document

$qb->insert('collectionName', [
	'name'	=>	'Alex',
	'age'	=>	22,
	'likes'	=>	['whisky', 'gin']
]);

Update a single document

$qb
	->where(['name' => 'Alex'])
	->set([
		'country' => 'UK',
		'job' => 'Developer'
	])
	->push('likes', ['PHP', 'coffee'])
	->update('collectionName');

Delete a single document

$qb
	->where(['name' => 'Alex'])
	->delete('collectionName');

Search for matching documents

$results = $qb
	->whereGt('age', 21)
	->whereIn('likes', ['whisky'])
	->where('country', 'UK')
	->get('collectionName');

If you find any bugs please file a report in the Issue tracker

If you find this software useful please consider donating, thank you =]

https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif

统计信息

  • 总下载量: 1.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 59
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-25