All Projects β†’ konsultaner β†’ jsonOdm

konsultaner / jsonOdm

Licence: MIT license
A JSON ODM (object document mapper) for JavaScript to use on the server or in the browser.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jsonOdm

Mongorito
🍹 MongoDB ODM for Node.js apps based on Redux
Stars: ✭ 1,409 (+1383.16%)
Mutual labels:  odm
Qxorm
QxOrm library - C++ Qt ORM (Object Relational Mapping) and ODM (Object Document Mapper) library - Official repository
Stars: ✭ 176 (+85.26%)
Mutual labels:  odm
xenus
A simple and elegant MongoDB ODM
Stars: ✭ 32 (-66.32%)
Mutual labels:  odm
Js Data
Give your data the treatment it deserves with a framework-agnostic, datastore-agnostic JavaScript ORM built for ease of use and peace of mind. Works in Node.js and in the Browser. Main Site: http://js-data.io, API Reference Docs: http://api.js-data.io/js-data
Stars: ✭ 1,599 (+1583.16%)
Mutual labels:  odm
Jkes
A search framework and multi-tenant search platform based on java, kafka, kafka connect, elasticsearch
Stars: ✭ 173 (+82.11%)
Mutual labels:  odm
Ts Mongoose
Automatically infer TypeScript interfaces from mongoose schemasπŸ™€
Stars: ✭ 188 (+97.89%)
Mutual labels:  odm
Jedlik
DynamoDB ODM for Node
Stars: ✭ 100 (+5.26%)
Mutual labels:  odm
derivejs
DeriveJS is a reactive ODM - Object Document Mapper - framework, a "wrapper" around a database, that removes all the hassle of data-persistence by handling it transparently in the background, in a DRY manner.
Stars: ✭ 54 (-43.16%)
Mutual labels:  odm
Wither
An ODM for MongoDB built on the official MongoDB Rust driver.
Stars: ✭ 174 (+83.16%)
Mutual labels:  odm
Odmantic
Async ODM (Object Document Mapper) for MongoDB based on python type hints
Stars: ✭ 240 (+152.63%)
Mutual labels:  odm
Dynamo Easy
DynamoDB client for NodeJS and browser with a fluent api to build requests. We take care of the type mapping between JS and DynamoDB, customizable trough typescript decorators.
Stars: ✭ 133 (+40%)
Mutual labels:  odm
Express Cassandra
Cassandra ORM/ODM/OGM for Node.js with optional support for Elassandra & JanusGraph
Stars: ✭ 163 (+71.58%)
Mutual labels:  odm
Mongolid Laravel
Easy, powerful and ultrafast MongoDB ODM for Laravel.
Stars: ✭ 222 (+133.68%)
Mutual labels:  odm
Awesome Python Models
A curated list of awesome Python libraries, which implement models, schemas, serializers/deserializers, ODM's/ORM's, Active Records or similar patterns.
Stars: ✭ 124 (+30.53%)
Mutual labels:  odm
influxable
A lightweight python ORM / ODM / Client for InfluxDB
Stars: ✭ 36 (-62.11%)
Mutual labels:  odm
Orango
ArangoDB Object Modeling for Node.js, Foxx and Modern Web Browsers
Stars: ✭ 103 (+8.42%)
Mutual labels:  odm
Mongodm
A golang object document mapper (ODM) for MongoDB
Stars: ✭ 178 (+87.37%)
Mutual labels:  odm
petstore
A simple skeleton to build api's based on the chubbyphp-framework, mezzio (former zend-expressive) or slim.
Stars: ✭ 34 (-64.21%)
Mutual labels:  odm
mars
Mars - ODM Framework for MongoDB (MongoDB ODM Java )
Stars: ✭ 35 (-63.16%)
Mutual labels:  odm
Php Mongo
MongoDB ODM. Part of @PHPMongoKit
Stars: ✭ 228 (+140%)
Mutual labels:  odm

Build Status Code Climate Test Coverage npm npm npm GitHub stars GitHub issues

JSON ODM

by Konsultaner, Richard Burkhardt

This Project aims to be provide a json object document mapper.
Why would I need this?
There are many cases where you do not want to have the server query your data. You may also see this mapper as a fancy way to filter your data or prepare a view model. The original use case was an ionic app that was not interactive so providing a server backend was not needed, but structuring my data into joinable collections seemed very helpful.

And if you can use a server you may consider our new WebSocket server project "connectanum" for Publish/Subscribe and RPC communication

If you like the project please support it with a star here on GitHub

If commercial support is needed please contact me.

Docs

You can find the documentation here or compiled to the folder /docs/gen/*.

Road map

  • Implement query methods from mongo db
    • Comparison 100%
      • $eq
      • $gt
      • $gte
      • $lt
      • $lte
      • $ne
      • $in
      • $nin
    • Logical 100%
      • $or
      • $and
      • $not(= $nand as alias)
      • $nor
    • Element 100% (+ $isNull, for is null or undefined)
      • $exists
      • $type
    • Evaluation 100%
      • $mod
      • $regex
      • $text
      • $where
    • Geospatial 50% (maybe have a hard and a soft check -> performance)
      • $geoWithin
      • $geoIntersects
      • $near
      • $nearSphere
    • Array 0% i may not implement the first two
      • $all
      • $elementMatch
      • $size
    • Aggregation
      • Pipeline 30% ($limit and $skip is implemented as $result(skip,limit))
        • $project
        • $match
        • $redact
        • $limit
        • $skip
        • $unwind
        • $sort
        • $geoNear
        • $out
      • Grouping 70% ($count is used to count the results)
        • $group
        • $count
        • $sum
        • $avg
        • $first
        • $last
        • $min
        • $max
        • $push
        • $addToSet
      • Operators 20% ($mod is renamed $modulo, because Evaluation has a $mod)
        • Boolean
        • Set
        • Comparison
        • Arithmetic
        • String
        • Array
        • Date
        • Conditional
        • Variable
        • Grouping
  • Support Promise/A+ sources for the odm.addSource
  • Full CRUD support
  • Aggregation

Install from NPM-Package

npm install json-odm

Build and run tests, both minified and unminified

Since PhantomJs has been archived, jsonOdm needed to switch to chrome headless for its test. To run tests have Chrome installed!

npm install json-odm
cd npm_modules/json-odm/
npm install
gulp

Browser Support

Unit test ran successfully under Chrome,iOS7+,IE9+,Firefox,Android 4.4.2+
To be tested: Safari on OSX, IE8(test driver does not run in IE < 9 so it will be hard to test)

Example

This is only a basic example. Find a lot more in the docs, i.e. how to use $geoWithin

<!-- add minified version from https://github.com/konsultaner/jsonOdm/tree/master/bin to the html head -->
<script type="text/javascript" src="js/json.odm.min.js"></script>
// initialize The mapper
var odm = new jsonOdm();
// add a source to the mapper
odm.addSource('people',{
   "Person" : [
       {"id":1,"name":"Richi",jobId:1,hobbyIds:[1,3,4]},
       {"id":2,"name":"Dave",jobId:2,hobbyIds:[2,4]},
       {"id":3,"name":"Tom",jobId:3,hobbyIds:[3,5]},
       {"id":4,"name":"Lisa",jobId:4,hobbyIds:[1,2,3]},
       {"id":5,"name":"Hanni",jobId:3,hobbyIds:[1,5]},
       {"id":6,"name":"Selma",jobId:3,hobbyIds:[1,4]},
       {"id":7,"name":"Ralf",jobId:1,hobbyIds:[4,3]}
   ],
   "Jobs" : [
       {"id":1,"name":"plumber"},
       {"id":2,"name":"programmer"},
       {"id":3,"name":"chef"},
       {"id":4,"name":"hairdresser"}
   ],
   "Hobbies" : [
       {"id":1,"name":"swimming"},
       {"id":2,"name":"cycling"},
       {"id":3,"name":"fishing"},
       {"id":4,"name":"coding"},
       {"id":5,"name":"dancing"}
   ]
},true);
// instantiate a collection object
var people = new odm.Collection('Person');
people.$hasOne("jobId","id","Jobs","job");
people.$hasMany("hobbyIds","id","Hobbies","hobbies");

var q = people.$query();
// get all hairdresser and plumber
var hairdresser = q.$or(
    q.$branch("jobId").$eq(1),
    q.$branch("jobId").$eq(4)
).$all();

// get all but hairdressers and plumbers
var hairdresser = q.$and(
   q.$branch("jobId").$ne(1),
   q.$branch("jobId").$ne(4)
).$all();

// delete all plumbers
q.$branch("job","name").$eq("plumber").$delete();
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].