Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

adonis-lucid-mongodb

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adonis-lucid-mongodb - npm Package Compare versions

Comparing version 0.10.8 to 0.11.0

src/LucidMongo/Model/Mixins/FieldTypes.js

2

package.json

@@ -8,3 +8,3 @@ {

},
"version": "0.10.8",
"version": "0.11.0",
"scripts": {

@@ -11,0 +11,0 @@ "lint": "standard",

@@ -508,2 +508,24 @@ 'use strict'

/**
* date fields auto convert to moment
*
* @return {Array}
*
* @public
*/
static get dateFields () {
return []
}
/**
* date fields auto convert to GeoPoint
*
* @return {Array}
*
* @public
*/
static get geoFields () {
return []
}
/**
* created at field getter method, by default

@@ -907,3 +929,3 @@ * it returns an instance of moment js.

set (key, value) {
this.attributes[key] = value
this.attributes[key] = this.mutateProperty(key, value)
return this

@@ -1188,3 +1210,3 @@ }

get (key) {
return this.attributes[key]
return this.accessProperty(key, this.attributes[key])
}

@@ -1289,5 +1311,5 @@

class ExtendedModel extends mixin(Model, Mixins.AccessorMutator, Mixins.Serializer, Mixins.Persistance, Mixins.Dates, Mixins.Hooks) {
class ExtendedModel extends mixin(Model, Mixins.AccessorMutator, Mixins.Serializer, Mixins.Persistance, Mixins.Dates, Mixins.Hooks, Mixins.FieldTypes) {
}
module.exports = ExtendedModel

@@ -73,2 +73,4 @@ 'use strict'

AccessortMutator.mutateProperty = function (property, value) {
// transform field with type
value = this.getValueWithType(property, value)
const setter = util.makeSetterName(property)

@@ -75,0 +77,0 @@ if (typeof (this[setter]) === 'function') {

@@ -17,3 +17,4 @@ 'use strict'

Persistance: require('./Persistance'),
FieldTypes: require('./FieldTypes'),
Serializer: require('./Serializer')
}

@@ -32,3 +32,3 @@ 'use strict'

const insertHandler = function * () {
const values = this.attributes
const values = this.getStoreValues(this.attributes)
if (!values || _.size(values) < 1) {

@@ -75,3 +75,3 @@ throw CE.ModelException.invalidState(`Cannot save empty ${this.constructor.name} model`)

yield query.connect()
const dirtyValues = this.$dirty
const dirtyValues = this.getStoreValues(this.$dirty)
if (!_.size(dirtyValues) && !this.unsetFields.length) {

@@ -78,0 +78,0 @@ return 0

@@ -29,3 +29,3 @@ 'use strict'

.transform((result, value, key) => {
result[key] = this[key]
result[key] = this.getFormatedField(key, this[key])
})

@@ -32,0 +32,0 @@ .merge(this.initializeComputedProperties())

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc