Giter Club home page Giter Club logo

mongolia's People

Contributors

chellmuth avatar garciasouza avatar jrom avatar masylum avatar timoxley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mongolia's Issues

NPM install failing

Is this using some non-NPM fork/branch of the mongodb driver?

Error: No satisfying version found for 'mongodb'@'>=0.8.0'

bug on lib/helpers/update_document.js

Hi guys.

I found a bug on the file mongolia/lib/helpers/update_document.js, line 85. If the document informated (VALIDATOR.update, line 84) don't has no one key, then will throw the error {"message":"Cannot read property '0' of undefined"}. Solution is simple:

instead of
, special_op = keys[0][0] === '$'
use
, special_op = keys[0] && keys[0][0] === '$'

Why this problem? Because I sent an object without keys ({}) to insert in the mongodb.

Sorry the english.

integration_tests fail

when running tests with latest mongo, integration_tests fail:

» 12 asserts

✿ integration/integration_test.js :

Insert documents with before/afterInsert hooks => ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓

Update embedded documents =>
✗ => AssertionError: 1 ==
    at Object.equal (/cygdrive/c/Users/vincent/Documents/devel/test/node_modules/mongolia/node_modules/testosterone/lib/testosterone.js:47:39)
    at /cygdrive/c/Users/vincent/Documents/devel/test/node_modules/mongolia/test/integration/integration_test.js:83:20
    at Collection.update (/cygdrive/c/Users/vincent/Documents/devel/test/node_modules/mongodb/lib/mongodb/collection.js:370:12)
    at /cygdrive/c/Users/vincent/Documents/devel/test/node_modules/mongolia/lib/model.js:360:18
    at [object Object].collection (/cygdrive/c/Users/vincent/Documents/devel/test/node_modules/mongodb/lib/mongodb/db.js:161:14)
    at Object.getCollection (/cygdrive/c/Users/vincent/Documents/devel/test/node_modules/mongolia/lib/model.js:29:8)
    at Object.updateEmbeddedDocument (/cygdrive/c/Users/vincent/Documents/devel/test/node_modules/mongolia/lib/model.js:355:11)
    at /cygdrive/c/Users/vincent/Documents/devel/test/node_modules/mongolia/test/integration/integration_test.js:82:16
    at [object Object]. (/cygdrive/c/Users/vincent/Documents/devel/test/node_modules/mongodb/lib/mongodb/collection.js:687:5)
    at [object Object].emit (events.js:67:17)

Request regarding name "Mongolia"

Hello, while I researching nodejs platform I accidentally found out your project "Mongolia". And I do believe that you aware of there's a whole county and the nation that named "Mongolian". I respect technological work and there's a meaning regarding MongoDB. But as a Mongolian, It's not acceptable to choose a such name. And it's possible that your singular naming will create confusion and misconception. I sincerely request to change the name of your project.

Alias

In order to save disk space, sometimes people need to name their fields with obscure names.
I think its a good idea to let users define alias for their field names.

MODEL.alias = {
  created_at: 'ca',
  name: 'n'
};

foo.mongo('findOne', {name: 'bar'}, function (err, doc) {
  console.log(doc.name); // => 'bar'
  console.log(doc.created_at); // => 'Jun 12, 2011 ...'
  console.log(doc.n); // => 'bar'
});

This feature if used will add a little overhead to setup the setters/getters on returning elements.

Tests

Add missing tests

Async hooks

onCreate, onUpdate, afterCreate and afterUpdate should accept callbacks.

This way I could remove the unnecessary afterCreateInstance

Proxy cursor

By doing this I could implement alias, namespaces and mappings for find operations too.

Just proxy the find method to return a proxied cursor, and so on... INCEPTION!

Integrate a paginator

We could have a findPaginated custom collection function that returns {results, paginator}

Remove dependencies

Mongolia should work out of the box.
All the missing things from ext.js or class.js should go to utils.js

Recursive `namespacing` and `mapping`

I think it would be nice to allow deeper attributes, so we could have:

User.maps = {
  email: String
, posts: {
    count: Number
  , titles: function (val) {
      return val.join(', ');
    }
  }
};
User.namespaces = {
  post_form: ['email', 'post.titles']
, post_admin: ['post']
}

future

Just curious as to the plans for the future of this project?

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.