Integrate DynamoDb into Sails js

Actually, I tried to run the project with Sailsjs as the DynamoDB database.

Searching the Internet I found this package https://github.com/dohzoh/sails-dynamodb , I found that they have complete documentation for the initial setup.

I installed this package in my project, and I started setting up the project as follows:

config / connections.js:

dynamoDb: { adapter: "sails-dynamodb" }, 

and config / models.js:

 connection: 'dynamoDb' 

I put my amazon keys in node_modules / sails-dynamodb / credentials.json

I am creating the following model:

 module.exports = { attributes: { idFacebook : { type : 'string', unique: true }, emailUser : { type : 'string', required : true }, nameUser : { type: 'string', required : true }, lastNameUser : { type: 'string', required : true } } }; 

And when I rise, raise the following error:

  /home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:32 throw err; ^ Error: define no longer accepts schema callback, migrate to new api at Object.vogels.define (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/node_modules/vogels/lib/index.js:126:11) at Object.module.exports.adapter._getModel (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/index.js:169:23) at Object.module.exports.adapter.define (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/index.js:289:33) at /usr/lib/node_modules/sails/node_modules/waterline/lib/waterline/adapter/ddl/index.js:60:15 at bound (/usr/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:957:21) at applyInOriginalCtx (/usr/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:416:80) at wrappedCallback (/usr/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:315:18) at _normalizeCallback.callback.success (/usr/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/normalize.js:33:31) at _switch (/usr/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/factory.js:48:28) at Response.<anonymous> (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/index.js:340:21) at Request.<anonymous> (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:350:18) at Request.callListeners (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/sequential_executor.js:100:18) at Request.emit (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/sequential_executor.js:77:10) at Request.emit (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:604:14) at Request.transition (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/request.js:21:12) at AcceptorStateMachine.runTo (/home/uppersky01/proyectos/gameMouseCat/node_modules/sails-dynamodb/node_modules/vogels/node_modules/aws-sdk/lib/state_machine.js:14:12) 

I am looking for similar errors, however I could not find an answer to this problem. Hope someone can help me.

thanks

+5
source share
1 answer

I had the same problem too. You can try downgrading the current version of the "vogels" module. This worked for me a while ago, but I had to update it later because I had to use the newer version of "aws-sdk".

Perhaps vogels@0.12.0 work.I do not remember it for sure, but you can try a few more versions.

+1
source

All Articles