Eigentlich habe ich versucht, ein Projekt mit Sailsjs als DynamoDB Datenbank zu starten.Integriere DynamoDb in Sails js
Suche im Internet fand ich dieses Paket https://github.com/dohzoh/sails-dynamodb, fand ich, dass sie vollständige Dokumentation für die Ersteinrichtung haben.
ich installiert, um dieses Paket zu meinem Projekt, und ich ging, das Projekt wie folgt festgelegt:
config/connections.js:
dynamoDb: {
adapter: "sails-dynamodb"
},
und config/models.js:
connection: 'dynamoDb'
Ich steckte meine Amazon Schlüssel in node_modules/sails-dynamodb/credentials.json
ich das nächste Modell erstellen:
module.exports = {
attributes: {
idFacebook : {
type : 'string',
unique: true
},
emailUser : {
type : 'string',
required : true
},
nameUser : {
type: 'string',
required : true
},
lastNameUser : {
type: 'string',
required : true
}
}
};
Und wenn ich Segel heben, werfen den nächsten Fehler:
/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)
Ich bin für ähnliche Fehler suchen, aber ich habe keine Antwort auf dieses Problem gefunden . Ich hoffe, dass mir jemand helfen kann.
Vielen Dank
Hier ist ein aktiverer Dynamodb-Adapter: https://github.com/gadelkareem/sails-dynamodb. Ich würde stattdessen versuchen, das zu verwenden. –
Hat es funktioniert? Wenn ja, bitte nimm es als Antwort an. –