All Projects → mongodb-labs → mongorover

mongodb-labs / mongorover

Licence: Apache-2.0 license
Intern project - MongoDB driver for the Lua programming language - This Repository is NOT a supported MongoDB product

Programming Languages

c
50402 projects - #5 most used programming language
lua
6591 projects
CSS
56736 projects
CMake
9771 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to mongorover

Egg Mongo Native
MongoDB egg.js plugin using native driver.
Stars: ✭ 69 (+32.69%)
Mutual labels:  mongodb-driver
Mongo Perl Driver
Perl driver for the MongoDB
Stars: ✭ 203 (+290.38%)
Mutual labels:  mongodb-driver
MongoDBLink
MongoDB driver for Mathematica
Stars: ✭ 18 (-65.38%)
Mutual labels:  mongodb-driver
Lua Mongo
MongoDB Driver for Lua
Stars: ✭ 81 (+55.77%)
Mutual labels:  mongodb-driver
Mongojs
Node.js module that implements the offical mongo api
Stars: ✭ 1,782 (+3326.92%)
Mutual labels:  mongodb-driver
Mongodb Plugin
MongoDB Plugin for Java
Stars: ✭ 236 (+353.85%)
Mutual labels:  mongodb-driver
Mongoc.jl
MongoDB driver for the Julia Language
Stars: ✭ 46 (-11.54%)
Mutual labels:  mongodb-driver
laravel-logger
📝 Laravel 日志的扩展,更规范,更快速,更有效。
Stars: ✭ 21 (-59.62%)
Mutual labels:  mongodb-driver
Java Specialagent
Automatic instrumentation for 3rd-party libraries in Java applications with OpenTracing.
Stars: ✭ 156 (+200%)
Mutual labels:  mongodb-driver
ArchitectNow.ApiStarter
Sample ASP.NET Core 2 API Setup used by ArchitectNow for corresponding workshop presentations
Stars: ✭ 35 (-32.69%)
Mutual labels:  mongodb-driver
Erlmongo
Erlang driver for MongoDB with gridfs that works with maps and proplists
Stars: ✭ 90 (+73.08%)
Mutual labels:  mongodb-driver
Mongo Php Library
MongoDB PHP library
Stars: ✭ 1,391 (+2575%)
Mutual labels:  mongodb-driver
Mongo Swift Driver
The official MongoDB driver for Swift
Stars: ✭ 242 (+365.38%)
Mutual labels:  mongodb-driver
Avocado
Strongly-typed MongoDB driver for Rust
Stars: ✭ 70 (+34.62%)
Mutual labels:  mongodb-driver
online-training
Online Training website using ASP.Net Core 2.0 & Angular 4
Stars: ✭ 26 (-50%)
Mutual labels:  mongodb-driver
Mongo Hhvm Driver Unsupported
[Archive] Experimental MongoDB driver for HHVM - This Repository is NOT a supported MongoDB product
Stars: ✭ 55 (+5.77%)
Mutual labels:  mongodb-driver
Mongodb.entities
A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management
Stars: ✭ 204 (+292.31%)
Mutual labels:  mongodb-driver
wily
Build Node.js APIs from the command line (Dead Project 😵)
Stars: ✭ 14 (-73.08%)
Mutual labels:  mongodb-driver
java-spring-boot-mongodb-starter
MongoDB Blog Post: REST APIs with Java, Spring Boot and MongoDB
Stars: ✭ 57 (+9.62%)
Mutual labels:  mongodb-driver
mango
Use mongo-go-driver like mgo
Stars: ✭ 37 (-28.85%)
Mutual labels:  mongodb-driver

mongorover

Info:See the mongo site for more information. See github for the latest source.
Author: Christopher Wang
Maintainer:Jesse Davis

About

The mongorover module contains tools for interacting with MongoDB databases from Lua. It wraps both the 1.2.0-dev version of the MongoDB C Driver and libbson library. Currently, this driver only provides simple functionality: the basic CRUD operations, aggregation, along with functions such as getDatabaseNames and getCollectionNames. While this driver doesn't provide all the specifications within the MongoDB Driver CRUD API, the parts that are implemented do comply with their respective specs.

Bugs / Feature Requests

Think you’ve found a bug? Want to see a new feature in mongorover? Please open a github issue on this repository.

Please include all of the following information when opening an issue:

  • Detailed steps to reproduce the problem, including full traceback, if possible.

  • The exact lua version used

    $ lua -e "print(_VERSION)"
    
  • The exact version of mongorover used

    $ lua -e "print(require("mongorover")._VERSION)"
    

Security Vulnerabilities

If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.

Installation

Before installing mongorover, you have to install the MongoDB C Driver version 1.2, which is in beta at the time of this writing. Please download the latest 1.2 beta release from the C Driver releases page and follow the Mongo C Driver installation guide. If building on Windows, please refer to the Window specific section.

After installing the above C libraries successfully, you can install mongorover through the LuaRocks build system.

$ luarocks install mongorover

You can also use LuaRocks to install from source

$ luarocks make mongorover*.rockspec

Alternatively, you can build using CMake, even though it is highly encouraged to use the Luarocks ecosystem. You can build by executing the following commands in the home directory. Take note that unless forced to use Lua 5.1 (see comment below), CMake will use the highest version of Lua found.

$ mkdir build
$ cd build
$ cmake .. # can force Lua 5.1 by using -DLUA_FORCE_LUA51=ON
$ make .

Dependencies

The mongorover distribution is supported and tested on Lua 5.1.5 and 5.2.3.

Additional dependencies are:

  • MongoDB C Driver
  • To generate documentation: ldoc
  • To run the tests: Luaunit. At the current moment, the luarock is outdated, so please install from github.

Examples

A basic use case of using the mongorover driver is below. For more see the examples section of the mongorover docs and see the MongoDB CRUD Tutorial and the MongoDB Aggregation Tutorial.

> mongorover = require("mongorover")
> client = mongorover.MongoClient.new("mongodb://localhost:27017/")
> database = client:getDatabase("exampleDatabase")
> collection = database:getCollection("exampleCollection")
> result = collection:insert_one({x = 10})
> print(result, result.inserted_id)
<InsertOneResult object at table: 0x7fdc00f18340> ObjectID("559ff4bbd2b38b17296e56b1")

> print(collection:insert_one({x = 8}).inserted_id)
ObjectID("559ff4d0d2b38b17296e56b2")

> print(collection:insert_one({x = 11}).inserted_id)
ObjectID("559ff4d6d2b38b17296e56b3")

> find_results = collection:find({})

> for result in find_results do
>> for k,v in pairs(result) do
>>   print(k,v)
>> end
>> end

_id ObjectID("559ff4bbd2b38b17296e56b1")
x 10
_id ObjectID("559ff4d0d2b38b17296e56b2")
x 8
_id ObjectID("559ff4d6d2b38b17296e56b3")
x 11

Documentation

The documentation is hosted online at api.mongodb.org.

You will need ldoc installed to generate the documentation. Documentation can be generated in the doc/ directory by running the following command in the source directory.

$ lua [path to ldoc.lua] .

Testing

Before running tests, you need to make sure to be running a MongoDB in the background with authentication on. You can create the user to run the test suite with these commands in mongo shell.

use admin
db.createUser(
  {
    user: "mr_user",
    pwd: "mr_password",
    roles: [
       { role: "clusterMonitor", db: "admin" },
       { role: "readWrite", db: "mr_test_suite" },
       { role: "dbAdmin", db: "mr_test_suite" }
    ]
  }
)

The easiest way to run the tests is to run the following command in the test directory. Note that you will need Luaunit to run the tests. Make sure you installed luaunit from source instead of luarocks.

$ lua RunAllTests.lua
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].