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
1 answer

Use beginsWith to search in sort key using dynamoose .get

I'm starting to learn Dynamodb here, and currently trying to do a search on my table where PK is the partition key and SK is the range key. PK contains an email address, whereas SK contains value like AB_STATE, BC_STATE, MY_STATE. So I want to…
imin
  • 4,504
  • 13
  • 56
  • 103
1
vote
1 answer

createdAt missing in dynamodb item entry

I have a dynamodb table that I declared using dynamoose as below: const schema = new dynamoose.Schema({ "email": String, "name": String, "vehicleMotor": { "type": Number, "default": 0 }, "vehicleMotorId": String, …
imin
  • 4,504
  • 13
  • 56
  • 103
1
vote
1 answer

Virtual fields in Dynamoose

Does Dynamoose have support for schema.virtual()? Or is there any way to achieve this same behaviour? I can't see it in the v2 documentation but it seems that there was some sort of support for it in the past - see this. I know that Dynamoose is…
davidrv87
  • 838
  • 7
  • 16
1
vote
1 answer

DynamoDB/Dynamoose query based on ALL elements in an array

Is there any way using DynamoDB/Dynamoose to query based on an array field containing all of the specified elements? I'm making the move from MongoDB/Mongoose and I need something similar to the functionality of the $all operator in MongoDB…
developing2020
  • 322
  • 1
  • 9
1
vote
1 answer

Dynamoose problem when creating shcemas "Cannot create preexisting table" or "Cannot do operations on a non-existent table"

I am using a single Table approach for my dynamodb design. Take a look here (Single Table Structure Example). No need to read all the page. The idea is that several different kind of entities will be stored in the same table. (for example, orders,…
Sergio Romano
  • 31
  • 1
  • 5
1
vote
1 answer

switch Dynamodb region on the fly

Is there any way to switch between the DynamoDB regions on the fly by using javascript aws-sdk or dynamoose npm package? Suppose, 2 table exists in two different regions Mumbai (ap-south-1) and Frankfurt (eu-central-1). Initial when appliation boots…
1
vote
1 answer

Can't scan on DynamoDB map nested attributes

I'm new to DynamoDB and I'm trying to query a table from javascript using the Dynamoose library. I have a table with a primary partition key of type String called "id" which is basically a long string with a user id. I have a second column in the…
Damasia
  • 155
  • 2
  • 8
1
vote
1 answer

Scan until x items are found?

I'm writing a query to find all users whose usernames begin with a given prefix. I only want the query to return up to 10 items. My query right now is User.scan('username') .beginsWith(req.query.prefix) .limit(req.query.limit) .exec((err,…
Wishcle
  • 63
  • 5
1
vote
0 answers

NodeJS wrapper for Dynamo and Mongo

Is there a simple abstraction layer that supports both DynamoDB and MongoDB, failing that a simple wrapper on top of Dynamoose and Mongoose. I've tried building the wrapper myself but can't seem to work out how to accomplish this, I was hoping to do…
DeltaByte
  • 21
  • 2
  • 4
1
vote
1 answer

Scanning for all records with Dynamoose is very slow

I have a table with storage size of 2.7MB. I am trying to get all records using dynamoose scan method, but it is very slow (35 seconds to get 2.7MB) The code is written in node.js (typescript). First I used scan method and checked for…
student
  • 11
  • 2
1
vote
0 answers

Complex queries with dynamoose

I am trying to perform a complex filter operation with dynamoose query and I unable to get the syntax correct. For eg: Trying to filter height and weight of dogs and breed type Dog.query({ breed: 'poodle', height : { gt : 10 , le : 15 } , weight :…
1
vote
2 answers

How to avoid setting aws config as env variable externally while using dynamoose.js

My aws config doesn't work unless I set it externally through env variable db connection works only if I set the credentials externally like, export AWS_ACCESS_KEY_ID=abcde export AWS_SECRET_ACCESS_KEY=abcde export AWS_REGION=ap-south-1 export…
1
vote
1 answer

How to sort all items according to registration date in dynamoose

Summary: How to sort all items according to registration date. When I tried it gives me no output, My code is shown below Code sample: abcdschema.statics.fetchall = function fetchall(cb) { var id_temp='abcd'; …
Sabreena
  • 619
  • 2
  • 11
  • 25
1
vote
2 answers

3 column query in DynamoDB using DynamooseJs

My table is (device, type, value, timestamp), where (device,type,timestamp) makes a unique combination ( a candidate for composite key in non-DynamoDB DBMS). My queries can range between any of these three attributes, such as GET (value)s from…
Huzaib Shafi
  • 1,153
  • 9
  • 24
1
vote
2 answers

How can dynamoose have multiple models share a single table?

Can you use dynamoose to have multiple models share a single table? Here are two models that I have where I want them being saved in the same table and differentiate them by their type hash key and id range key. const Courses = dynamoose.model( …
coherence
  • 93
  • 1
  • 11