
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@xyezir/orientose
Advanced tools
Orientose is a OrientDB object modeling with support of schemas inspired by mongoose. Some features of mongoose are used in simplified way. Orientose will create database structure for you automatically from your schema.
Right know we have support only for schema-full.
npm test
var Orientose = require('orientose');
var Schema = Orientose.Schema;
var connection = new Orientose({
host: 'localhost',
port: 2424,
username: 'root',
password: 'yourpassword'
}, 'mydb');
var Orientose = require('orientose');
var Schema = Orientose.Schema;
var geojson = require('orientose-geojson');
var schema = new Schema({
name: { type: String, required: true, index: true, text: true },
isAdmin : { type: Boolean, default: false, readonly: true },
points : { type: Number, default: 30, notNull: true, min: 0, max: 99999 },
address : {
city : { type: String },
street : { type: String }
},
tags : [String]
});
schema.virtual('niceName').get(function() {
return 'Cool ' + this.name;
});
schema.pre('save', function(done) {
this.address.city = 'Kosice';
this.tags.push('admin', 'people');
done();
});
schema.index({ tags: 1 }, { unique: true} );
schema.plugin(geojson);
var User = connection.model('User', schema);
User.create({
name: 'Peter Max'
}, function(err, user) {
if(err) {
return console.log(err.message);
}
user.name.should.equal('Peter Max');
user.niceName.should.equal('Cool Peter Max');
user.address.city.should.equal('Kosice'); //there is a pre save hook
user.tags.length.should.equal(2); //there is a pre save hook
});
Alternative way with instance of document
var user = new User({
name: 'Peter Max'
});
user.points = 45;
user.save(function(err, user) {
if(err) {
return console.log(err.message);
}
user.name.should.equal('Peter Max');
user.points.should.equal(45);
});
var Orientose = require('orientose');
var Schema = Orientose.Schema;
var personSchema = new Schema.V({
name : { type: String },
address : {
city : { type: String },
street : { type: String }
}
});
var Person = connection.model('Person', personSchema);
var Orientose = require('orientose');
var Schema = Orientose.Schema;
var followSchema = new Schema.E({
when: { type: Date, default: Date.now, required: true }
}, {
unique: true //unique index for properties in/out
});
var Follow = connection.model('Follow', followSchema);
var Person = connection.model('Person');
var Follow = connection.model('Follow');
var Orientose = require('orientose');
var Schema = Orientose.Schema;
var followSchema = new Schema.E({
when: { type: Date, default: Date.now, required: true }
}, {
unique: true //unique index for properties in/out
});
var Follow = connection.model('Follow', followSchema);
Person.findOne({ name: 'Zlatko Fedor'}, function(err, person1) {
Person.findOne({ name: 'Luca'}, function(err, person2) {
Follow.create({
from: person1,
to: person2
}, function(err, follow) {
console.log(follow.when);
});
});
});
You can use dot notation
var Person = connection.model('Person');
Person.findOne({ name: 'Zlatko Fedor'}, function(err, person) {
person.set({
name: 'Luca',
'address.city': 'Presov',
address: {
street: 'Svabska'
}
});
person.name.should.equal('Luca');
person.address.city.should.equal('Presov');
person.address.street.should.equal('Svabska');
});
Finds a single document.
User.findOne({
name: 'Zlatko Fedor'
}, function(err, user) {
user.name.should.equal('Zlatko Fedor');
});
Finds multiple documents.
User.find({
name: 'Zlatko Fedor'
}, function(err, users) {
});
Finds a single document by rid.
User.findByRid(rid, function(err, user) {
user.name = 'Luca';
user.save(function(err, affectedRows) {
affectedRows.should.equal(1);
});
});
Remove a single document by a documents rid.
User.removeByRid(rid, function(err, affectedRows) {
affectedRows.should.equal(1);
});
Adds key path / schema type pairs to this schema.
schema.add({
name: { type: String }
});
Sets a schema option.
schema.set('name', { type: String });
Gets a schema option.
var options = schema.get('name');
options.type.should.equal(String);
Iterates the schemas paths similar to Array#forEach.
schema.eachPath(function(path, config) {
path.should.equal('name');
});
Defines a pre hook for the document.
schema.pre('save', function (next) {
if (!this.name) this.name = 'Zlatko Fedor';
next();
});
Creates a virtual type with the given name.
schema.virtual('niceName').get(function () {
return 'Mr. ' + this.name;
});
Registers a plugin for this schema.
var plugin = require('your-plugin-name');
schema.plugin(plugin, {
timeout: 3000
});
Adds an instance method to documents constructed from Models compiled from this schema.
schema.method('addSomePoints', function(value, callback) {
this.points += value;
this.save(callback);
});
var User = connection.model('User', schema);
var user = new User();
user.addSomePoints();
Adds static "class" methods to Models compiled from this schema.
schema.static('findByName', function(name, callback) {
return this.find({ name: name }, callback);
});
var User = connection.model('User', schema);
User.findByName('Zlatko Fedor', function (err, user) {
});
If you need to use other types from orient you can use Orientose.Type
var Orientose = require('orientose');
var Schema = Orientose.Schema;
var schema = new Schema({
count : { type: Orientose.Type.Integer },
count2 : { type: Orientose.Type.Long }
});
The MIT License (MIT)
Copyright (c) 2015 Zlatko Fedor zlatkofedor@cherrysro.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
OrientDB ODM with support for schemas inspired by mongoose
We found that @xyezir/orientose demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.