ui-js's People
ui-js's Issues
What license is this code under?
Hello, what license is this code under? I'm interested in using the arango orm.
ormjs: regeneratorRuntime undefined
/Users/noah/Projects/dreamer-api/node_modules/ormjs/fields/field-models.js:117
var ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(model) {
^
ReferenceError: regeneratorRuntime is not defined
at /Users/noah/Projects/dreamer-api/node_modules/ormjs/fields/field-models.js:117:32
https://github.com/uMaxmaxmaximus/ui-js/blob/master/server/core/orm/fields/field-models.js#L117
EDIT: I have forked this and made a purely ormjs repo, which also changes the build method to babel, and fixes this problem. It's here: https://github.com/OKNoah/ormjs
ormjs: Edge collection modelling
Hi, I'd like to work a bit on this package. I've forked it at https://github.com/OKNoah/ormjs.
I'm pretty new to ArangoDB.
I'd like to try add support for modelling edge collections. I believe this is done by var actsIn = db._createEdgeCollection("actsIn");
in the javascript driver, as seen here: https://github.com/arangodb/Cookbook/blob/master/recipes/Graph/ExampleActorsAndMovies.md
I'm just thinking of the syntax now. Open to suggestions. Perhaps like this.
import Model, { Edge } from './db'
/* A User lives at an Address */
export default class LivesAt extends Edge {
static schema = {
created: Date
}
}
export default class User extends Model {
static schema = {
name: String,
created: Date
}
}
export default class Address extends Model {
static schema = {
street: String,
city: String
}
}
const user = await User.add({
name: 'Will',
created: Date()
})
const address = await Address.add({
city: 'Bel Air'
})
const relationship = await LivesAt.add(user, address)
user.save()
address.save()
relationship.save()
ormjs: findByQuery feature
Currently it looks like the app just has one way to find things, which is with the byExample
method. We could add a findByQuery
method to allow passing a string query.
City.findByQuery(`
for city in outbound 'city/VANCOUVER' trips
return distinct city
`)
Any thoughts on this?
ormjs: Attributes
User.find(
{ active: true },
0,
10,
{ $attributes: ['_id', 'name', 'email'] }
)
This will do
static async find (selector, skip = 0, limit = 100, options) {
if (!selector) selector = {}
limit = Math.min(Math.max(limit, 0), 100)
selector._removed = false
const cursor = await this._call('byExample', selector, {skip, limit})
const documents = await cursor.all()
return documents.map(document => {
let doc = document
if (options.$attributes) doc = _.pick(document, options.$attributes)
return this._createModelByDocument(doc)
})
}
ormjs: includes syntax
I had the idea of using this syntax for joins.
User.findOne({
email: body.email,
$include: {
active: true,
$collection: Team
}
})
This would find a User by their email, then find any of their teams, using the filter {active: true}
.
ormjs: Arrays of sub-documents don't work, returns Promise
ValidationError: Field 'myField' must be Array, but have Promise
This happens any time you try to add a sub-document to an array of subdocuments and save.
See the test case I've added for this here: https://github.com/OKNoah/ormjs/blob/389429ced86a94a9304fdccdcd9372d6f75a9980/index.test.js
Add database host+port+auth
db = (0, _arangojs2.default)({ arangoVersion: 30000, url: 'http://root:password@localhost:8529' });
please:)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.