Questions tagged [dynamoose]

Dynamoose is a modeling tool for Amazon's DynamoDB for Node.js, inspired by Mongoose.

Summary

Dynamoose is a modeling tool for Amazon's DynamoDB NoSQL database service, written in for use with . Although inspired by , there are some key differences between the two packages due to differences between and .

Questions

Questions tagged with should not be tagged with .

Questions about server administration can be asked on https://dba.stackexchange.com.

Installation

$ npm i dynamoose

Resources

93 questions
1
vote
0 answers

Required value missing on post request to dynamoDB using dynamoose

Here's my model definition: const uuid4 = require('uuid4'); const dynamooseClient = require('./index').dynamoose; const supermarketShoppingCart = new dynamooseClient.Schema({ cartId: { type: Number, required: true, …
CodeTrooper
  • 1,890
  • 6
  • 32
  • 54
1
vote
1 answer

How to delete a table using dynamoose

How do you delete a table in dynamoose? For example is there a Model.deleteTable() function?
Harry
  • 2,965
  • 1
  • 13
  • 19
1
vote
1 answer

Dynamoose: how to get the latest rows?

I'm trying to get the latest rows of a table, using Dynamoose. I read about query().ascending() and query.descending(), but I need to query the whole table, which requires the hashkey to be empty, as far as I understood. scan() doesn't support…
Mr. B.
  • 8,041
  • 14
  • 67
  • 117
0
votes
0 answers

Dynamoose TypeError

I am running into a weird issue with dynamoose... The stack is as below: TypeError: Cannot read properties of undefined (reading 'attributeTypes') The errors happens in the following function of Item.js: static isDynamoObject(object, recursive) { …
0
votes
1 answer

How do I update global secondary indexes and keys in dynamodb table from my dynamodb schema update?

I have a schema const schema = new Schema( { id: { type: String, hashKey: true, required: true, }, name: { type: String, required: true, }, email: { type: String, index: { …
Kescript
  • 30
  • 6
0
votes
1 answer

I can not use query in dynamoose becasue error: 'Index can't be found for query.'

I'm using nest JS 9 which are using dynamoDB and dynamoose. I found a library which can support me connect to db nestjs-dynamoose i tried to write a get many API but a got Error at .exec() const pagination = formatPagination(basePagination); …
AnhDao
  • 13
  • 3
0
votes
0 answers

How to query a DynamoDB index with Dynamoose?

I have a DynamoDB table with animals and I'm interacting with it using Dynamoose. My table has a 'UserId' attribute, that indicates the user that registered that animal. I want to write a query that finds all the animals registered by the same user,…
G. Hruschka
  • 814
  • 1
  • 6
  • 11
0
votes
1 answer

How to use Dynamoose combined with AWS SAM?

Let's say I have the following AWS SAM resource that creates a DynamoDB table: EmployeeTable: Type: AWS::DynamoDB::Table Properties: TableName: Employee AttributeDefinitions: - AttributeName: EmployeeId …
0
votes
0 answers

Simpler way of mocking chained calls in Jest

I have a function and I am using dynamoose lib under the hood to make queries to database simpler: export class MyService { private rep = new Rep("sometable"); public async get(id, user) { return await this.rep.instance …
fewfew
  • 231
  • 2
  • 10
0
votes
0 answers

DynamoDB ValidationException: A value provided cannot be converted into a number

I have very strange behavior in my Nest.js application with dynamoose. This is my location schema: import { NULL, Schema } from 'dynamoose'; export const LocationSchema = new Schema({ country: String, city: String, zipCode: String, …
0
votes
0 answers

How can I do limit after filtering in Dynamo?

Following this question. How can I do DynamoDB limit after filtering? Can I solve the issue mentioned above using dynamoose? I thought of using Elastic Search for querying. So can I use Dynamoose to do all complex queries which are possible through…
0
votes
1 answer

Error: Region is missing - @aws-sdk - Dynamoose - nodejs16

I am upgrading nodejs from older version to node 16 as AWS-SDK has announced end of support for Node.js 14.x. i am using dynamoose package for dynamodb connection and other operations. now with nodejs 16, getting region is missing error even though…
0
votes
0 answers

How to populate data in dynamoose

I'm building an API where a user can make a publication to be displayed on a thread. I'm trying to make the author data to be seen with the publication. This way the author data could be get like console.log( publication.author.completeName ) When…
Tiny Skillz
  • 191
  • 1
  • 1
  • 6
0
votes
0 answers

In Dynamoose, how to specify schema for field that allows either String or NULL?

I'm trying to define the schema for a field that will either be a string value or NULL. From what I can tell, this should work: myField: [String, dynamoose.type.NULL] However, when it encounters a null value in the table, I get the following…
Scott Thiessen
  • 873
  • 7
  • 20
0
votes
1 answer

Dynamoose: The Model object doesn't allow config as a parameter

I have created a model that was working when I had my backend functions running on my local machine, but when it uses AWS I get and authentication problem when the table is being queried: 2022-02-18T08:54:58.149Z …
Darren
  • 9
  • 6