234 questions
0
votes
1
answer
31
views
Firestore cardinality vs effective cardinality in Composite Indexing
My question is about indexing and cardinality in Firestore.
I have 3 fields:
owner_id: Thousands of users
domain: Hundreds of domains
category: Only 10 unique one
The composite index, which matches ...
0
votes
1
answer
63
views
Efficiently read Firestore's document reference field contents
I'm trying out Firestore with this data model:
a collection of pokemon, where a pokemon is { name: string, move?: Ref<move> }
collection of moves, where a move is { name: string }
I have data ...
2
votes
1
answer
4k
views
How many databases are allowed in a single mongodb cluster?
I'm working with a system that requires multiple databases for multiple organisation. A monolithic node Js server connects to these databases. The challenge is I may have 5000 organisation.
I wanted ...
0
votes
1
answer
106
views
Getting more useful data from a lookup on a many-to-many relationship in Fauna
I have a users collection and an invitations collection. Users can invite multiple users. Records in the invitations collection document these invites. Each record in invitations is shaped like this:
&...
0
votes
0
answers
26
views
Document stores (e.g. Firebase) - smaller documents or more updates?
I am learning Firebase after many years of using SQL RDBMSs. This is definitely a challenge.
Say, I have a collection of objects. Each object can belong to any number of categories. Categories have ...
1
vote
1
answer
837
views
How does DocumentDB failover happen if the the reader instance and writer instance have different instance types?
I have a DocumentDB cluster with exactly one replica instance ( db.r5.16xlarge ) and a primary instance ( db.r5.24xlarge ).
If something happens to the primary instance and a failover occurs, the ...
0
votes
1
answer
327
views
How to delete nested collections from an empty document in Firestore?
I have the following structure for one of my collections on Firestore:
main_database/root/comments/{commentId}/message: str
main_database/root/comments/{commentId}/replies/{replyId}/message: str
I ...
-2
votes
2
answers
253
views
Storing layered objects in a grid
Let's say I have a canvas where there are various objects I can add in, such as a/an:
Drawing
Image
Chart
Note
Table
For each object I need to store the dimensions and the layer order, for example ...
0
votes
2
answers
137
views
Remove a child object in Fauna DB
I need to remove a child object in FQL. Let me demonstrate with the following example:
{
"1": {
"name": "test"
},
"2": {
"name&...
0
votes
1
answer
332
views
Full Text Search in OrientDB JSON Data
I have following data in OrientDB 3.0.27 where some of the values are in JSON Array and some are string
{
"@type": "d",
"@rid": "#57:0",
"@...
0
votes
1
answer
2k
views
How can I reduce the size of this JSON record?
I'm working on reducing the size of my database records. Each record is on average around 5Kb of which 97% is used by an single array property.
This array describe object on an image and their ...
1
vote
0
answers
113
views
$match in lookup stage without removing local documents in mongoDB
Right now I have a lookup stage that matches a collection of answers with their respective questions. The problem I'm having is that on the $match if the question does not having a matching answer ...
1
vote
1
answer
394
views
How to un-nest and group collections in mongoDB
I'm don't understand how to unwind and then nested collections in mongoDB. basically I have two collections that are structured like this:
questions doc:
{
"_id" : 1,
"questions&...
0
votes
1
answer
474
views
Save data to tinydb from android studio app
I have not used tinydb before. I am trying to insert some data to tinydb database using the android app.
I have checked many videos and blogs but still confused about how to use it.
How can I create a ...
0
votes
1
answer
444
views
How to query data from nested document in mongodb?
I'm struggling with this nested document too much. I tried to read the document and also follow other SO responses to see if it works for me, but I'm not getting the results that I'm looking for. I ...
5
votes
2
answers
959
views
How does MongoDB cursor behave when the collection is being changed?
Suppose I'm using the cursor to iterate a subset of the documents, ordered by some field let's say.
What happens if while iterating, a new document is being inserted or a current one is being deleted?
...
0
votes
1
answer
249
views
How to save a single document field in cloud firestore into a local variable in flutter?
I would like to save a single document field into a local variable, but I am not able to do that.
Here is my code:
void getPostsData() async{
List<Widget> listItems = [];
String _title;
...
-1
votes
1
answer
816
views
Synchronize data between two Environments
What are the best practices to keep the data QA/UAT to best represent all scenarios PROD environment?
The intention is to have the lower environment as close as PROD environment so that we can ...
0
votes
3
answers
3k
views
How do I store a picture in azure blob storage in asp.net mvc application?
I am currently working on an ASP.Net application that stores student information. I am required to store the following information:
Student number
Name
Email address
Home address
Contact no.
Upload ...
0
votes
3
answers
5k
views
How to bulk delete (say millions) of documents spread across millions of logical partitions in Cosmos db sql api?
MS Azure documentation does not talk anything about it. Formal bulk executor documentations talks only about insert and update options, not delete. There is a suggested java script server side program ...
3
votes
1
answer
218
views
Branch and Merge abilities in a Document Database?
When I think of a document database, I think of a bunch of JSON files. (I imagine it is more complex than that, but that is how envision it.)
In an upcoming project, we need the ability to deal with ...
0
votes
1
answer
206
views
Mongoose commands analogous to relational database commands
I am very confused between schema, model, instance of a model, and collection in Mongoose.
My understanding is as follows:
Mongoose.schema( { } ) - analogous to defining the columns of a table in ...
2
votes
1
answer
134
views
How to partition my User Permission Data using CosmosDB
I have decided to use CosmosDB in order to store my users permissions data. Our permissions are very dynamic in nature and thus a non relational database makes sense.
For a permission database, it ...
2
votes
2
answers
350
views
How could I filter by date and location availability in firestore?
In my Firebase project I need to query all users who are available on a certain date at a certain city and sort by some other criteria.
Since we can't use multiple "array-contains" operations in one ...
1
vote
0
answers
58
views
Absorbing N in a M:N relationship
I am encountering an issue I am trying to wrap my head around. I am using learnmongodbthehardway as a resource to define my options modelling a M:N relationship. According to this link I have two ...
2
votes
0
answers
307
views
2 phase commit implementation
I'm trying to implement a 2-phase commit over a document database which supports only single-phase commit using transaction info on the inserted data.
I understand the theory behind 2-phase commit, ...
0
votes
0
answers
60
views
Document-databse implementaion of one-to-many relationship
Designing data intensive application by Martin Kleppmann says one-to-many relationship is implemented in document database using tree hierarchy. For example as given in code below user can hold ...
1
vote
1
answer
430
views
Delete multiple documents of a particular collection matching a criteria in RavenDB
I am trying to delete multiple documents of a particular collection meeting certain criteria. Ideally after deleting these documents I need to add new documents. Even though the new documents are ...
0
votes
1
answer
147
views
How to store locations in ArangoDB?
I am building a web application where I need to store a large number of unique addresses as nodes in ArangoDB.
One approach would be using a hierarchical graph model: a country node connected to ...
0
votes
1
answer
64
views
How is Result-Set Query Scale done in Google Cloud Datastore
It is mentioned that making queries in Google Cloud Datastore is as expensive, with regards to time, as the number of results, which means that, for example, the time it takes to run any query would ...
0
votes
1
answer
273
views
Query to get specific sub-doc using aggregation in mongoDB?
I'd like to know a query in which I could get a specific sub-doc using it's ObjectId- or even it's "store" name if it's easier- using the aggregation method. I'm pretty sure I can use $project but I'm ...
0
votes
1
answer
903
views
Firestore - trigger when a document is requested but not found, or when an expired document is read?
I have an app where all data shown to the user is received from firestore documents. These documents consists of either user generated content or data that's been imported from 3rd party APIs. The ...
3
votes
2
answers
682
views
While creating new document in ravendb, collection name is missing in metadata, and the document is marked under @empty collection
I am trying to create a new collection in ravendb using the apollo node client. Although the document is created and stored in ravendb, the "collection" value from metadata is missing. And as a result ...
2
votes
2
answers
4k
views
CosmosDb Partition Key For Nested Java Object/Json (Spring Boot)
I'm trying to partition a collection based on a nested Java object and the corresponding Json. I know it might seem unreasonable to do this, but I am working on a project far into development, and the ...
2
votes
1
answer
39
views
transforming foreign constraints in raven document db
I have following entity "MyEntity" in my RavenDb
{
Id: {Guid}
//...
//...
}
In the application there might occur a specific event relating to elements of MyEntity.
Not I want to associate users ...
-1
votes
1
answer
266
views
Considering database options for new web application
I know this is a topic that's been addressed ad nauseam but I also know there are people who enjoy opining about databases so I figured I'd just go ahead and ask the question again.
I'm building out ...
2
votes
1
answer
69
views
Couchbase modeling techniques
I'm doing some research for my team, trying to understand couchbase. Right now, I'm looking at modeling practices in couchbase.
I found this article, written in August 2016, that talks about ...
1
vote
3
answers
1k
views
Reading single document from DocumentDB
I cannot read single document by id from DocumentDB. I am building application and I have exact problem like this one. I don't understand what am I missing. Let's say I have Users collection and I ...
0
votes
1
answer
2k
views
Store "extended" metadata on entities stored in Azure Cosmos DB as JSON documents
We are building a REST API in .NET deployed to Azure App Service / Azure API App. From this API, client can create "Products" and query "Products". The product entity has a set of ...
0
votes
1
answer
195
views
Azure Document DB : Creation of a collection is throwing "DocumentClientException" with error message "Session token specified is invalid"
I am getting the below exception "Microsoft.Azure.Documents.DocumentClientException: Message: {"Errors":["Session token specified is invalid."]}"in the workflow which creates a collection with the ...
0
votes
0
answers
73
views
Generalized DocumentDB / CosmosDB Partitioning Strategy
From all the research I've done it seems that even when using a partition key in CosmosDB/DocumentDB you may run into an issue with capacity if that partition hits the 10gb limit. I've seen strategies ...
0
votes
0
answers
206
views
How to Query Cosmos DB using Document DB client
For some reason, I can only use Document DB Client to query my Cosmos Database, so should I use ReadDatabaseAsync or ReadDocumentAsync?
Or something? For the URI ID, where could I find it?
0
votes
1
answer
2k
views
Querying nested subtrees in Cosmos DB
Let's say I have a parent-child-grandchild-etc relationship in a Cosmos document, represented by the following JSON:
"id": "someUniqueString",
"peepsNkids": [
"Jane": [
"Joe": [],
...
0
votes
2
answers
258
views
Is it possible in Cosmos DB to create a singly linked list of documents?
One problem I commonly solve is that of keeping immutable versions of a document rather than editing the document. When asked for the document, retrieve the most recent version.
One way to do this is ...
0
votes
1
answer
2k
views
Multiple partitions in COSMOS DB collection
1) I have a Cosmos DB collection with about 500k documents and which is Partitioned by a property "SITEID". In the Query Request Options only one partition key value can be passed. In my case I have ...
4
votes
1
answer
3k
views
Does Cosmos DB support cross partition transactions?
I'd like to move a document to another partition by changing the partition key. I have read somewhere that the document would have to be deleted first and a new one with the new partition key would ...
2
votes
1
answer
6k
views
Firestore multiple querys on the same field [duplicate]
We are building a app where we need to show nearby posts, made by users. A post should only be shown, if it is not more as 4 hours since posting. Because firestore doesn't provide geoquerys, i have to ...
-2
votes
1
answer
66
views
How to design document collections not like SQL, given the 2MB limit?
Here's the issue I'm having in moving from SQL to a document db with a 2MB limit on documents. Suppose I have an entities that looks like this
unit
id
item[]
item
id
name
If item[] can ...
2
votes
1
answer
925
views
Property reference is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
Azure Cosmos Document DB throws an error on executing a query like this -
SELECT DISTINCT VALUE
{
DocumentName: c.Name,
Count: COUNT(c.id),
Target: c.Target
}
FROM c where c.Target != ...
0
votes
2
answers
5k
views
Schema migration for Cosmos DB SQL API. Makes sense?
I started working on a Java project where the chosen database was the Azure Cosmos DB SQL API, so reading the SQL API Cosmos DB introduction I understood that that SQL, in this case, is only for query ...