NoSQL Databases

157

Solutions

305

Contributors

A NoSQL database provides a mechanism for storage and retrieval of data which is modeled in means other than the tabular relations used in relational databases. Motivations for this approach include: simplicity of design, simpler "horizontal" scaling to clusters of machines and finer control over availability. The data structures used by NoSQL databases (e.g. key-value, wide column, graph, or document) are specified from those used by default in relational databases, making some operations faster in NoSQL. Sometimes the data structures used by NoSQL databases are also viewed as "more flexible" than relational database tables.

Share tech news, updates, or what's on your mind.

Sign up to Post

A script that will backup MongoDB:-

1. Backup the db at 00:01 (cron job..)
2. Compress the backup file
3. Remove backups after 2 days
4. Alert by email of backups successful or fail

A script that will be used to restore the MongoDB
0
Rowby Goren Makes an Impact on Screen and Online
LVL 13
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Should I install memcache on a server which has MongoDB ?

What benefits will it bring ? Performance ?

Thanks
0
Assistance in backing up MongoDB databases:-

I am new to MongoDB and need some assistance in backing up databases by writing a script:-

a) Backup MongoDB at 00:01 kept for 7 days and are removed.  
b) An e-mail notification is sent to state that backups are completed or failed.
c) Is there a way to backup MongoDB i.e. transaction log backups or similar method, so 'point-in-time' restores can be done
0
I have this mongo shell that works:

db.nytimes.aggregate([ { $addFields: { docs: { $filter: { input: "$docs", as: "doc", cond:  {                     "$and": [
         { "$eq": [ "$$doc.section_name", "Technology" ] },                       { "$eq": [ "$$doc.document_type", "article" ] }
            ]                   }  } } } } ]).pretty();

How do I change this to make it work in java.
NYTimes.json
0
Somebody has a good example autocomplete search nodejs, express, mongodb
0
mongodb SSL encryption with application makes slow.
Can somebody help on this
0
How to create select the following records via Mongo DB query

Assume database has following rows

Pen/TEST/PO1/
Pen/PSO/QCD-Formats/QCD-file.pdf
Pen/PSO/QOD-Formats/QOD-F-29(00)_Stage 2.doc -
Pen/PSO/PDF/SFO/1.txt
Pen/PSO/2.txt  
Pen/QOD-F-23(00)_Stage 2.doc

1st Query to fetch the exact record matching the given folder path

ex:
user gives Pen/TEST/PO1/

expected result
Pen/TEST/PO1/

assume user gives: Pen/PSO/QOD-Formats/QOD-F-29(00)_Stage 2.doc

expected result:
Pen/PSO/QOD-Formats/QOD-F-29(00)_Stage 2.doc

2nd Query to fetch all the records matching the given folder path and it's files alone and not sub-folder's files

assume user gives: Pen/PSO/

expected result

Pen/PSO/QCD-Formats
Pen/PSO/QOD-Formats
Pen/PSO/PDF
Pen/PSO/2.txt  

Thanks.
0
I am trying to connect to a MongoDB database with asp.net core in C# with a userid and password.  Can anyone assist me in that respect?
0
I have a system in elasticsearch collecting performance metrics from my network. The space occupied is a lot, and I need to know how to optimize disk space. I have the idea that the project consists of having detailed samples of the last time (for example, one or two weeks). Beyond that time you can have historical samples, but with less detail.
I need to start organizing how to carry this forward.
0
redis used as cache data in at some point if we want to persist to SQL/No SQL is there a straight forward way?
0
Become a CompTIA Certified Healthcare IT Tech
LVL 13
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Sir,

I need a help on  Cassandra data model, is it a better way to design our table data structure   so that our bulk reads would be faster
please  suggest


CREATE TABLE IF NOT EXISTS screening_counts_by_location_year (
      total_screened_0_6 counter,
      male_0_6 counter,
      female_0_6 counter,

      total_screened_6_18 counter,
      male_6_18 counter,
      female_6_18 counter,

      total_screened counter,
      total_male counter,
      total_female counter,

      awc_screened counter,
      school_screened counter,
      college_screened counter,

      year varchar,

      location varchar,
      parent varchar,
      PRIMARY KEY((parent, location, year)));



CREATE TABLE IF NOT EXISTS screening_counts_by_location_year_mht (
      total_screened_0_6 counter,
      male_0_6 counter,
      female_0_6 counter,

      total_screened_6_18 counter,
      male_6_18 counter,
      female_6_18 counter,

      total_screened counter,
      total_male counter,
      total_female counter,

      awc_screened counter,
      school_screened counter,
      college_screened counter,
       mht_id varchar,
      year varchar,
      location varchar,
      parent varchar,
      PRIMARY KEY((parent, location, year), mht_id))
      WITH CLUSTERING ORDER BY (mht_id DESC);




CREATE TABLE rbsk_andr_v2.beneficiaryrecord (
    visitationpointtype text,
    reportdate date,
    zone text,
    district text,
    revenuedivision text,
    mandal text,
    village text,
    visitationpointcode text,
    universalid text,
    attendance text,
0
Dear Experts,

we have  back end application running on Cassandra and which has all our transaction data but we have a static data available in mysql
but i would like to know  if I would like to have queries between tables across two databases for the joins how that can be achieved.

Thanks
Roy...
0
Connection Error: No Mongos proxy available.

Environment: Node.js, MongoDB, Mongoose

Start.js
const mongoose = require('mongoose');


mongoose.connect(process.env.DATABASE,  { useNewUrlParser: true })
mongoose.Promise = global.Promise;
mongoose.connection
  .on('connected', () => {
    console.log(`Mongoose connection open on ${process.env.DATABASE}`);
  })
  .on('error', (err) => {
    console.log(`Connection error: ${err.message}`);
  });

.env file

DATABASE=mongodb://username:DBpassword@player-shard-00-00-1cmur.mongodb.net:27017,player-shard-00-01-1cmur.mongodb.net:27017,player-shard-00-02-1cmur.mongodb.net:27017
0
I want to write a init script to stop and start the MongoDB.
0
Hi,
i am currently working on the task of Data Migration from 1 cassandra cluster table to another cassandra cluster table using spark batch job.

i need a spark code for reading data from one cassandra cluster table and to process it in spark and then write results onto another existing cassandra cluster table.
0
{
 "_id" : "Sh",

"Name" : "HR",
"Form" : [
    {
        "Name" : "HR",
        "Permission" : {},
        "Fields" : [
            {
                "OutputFormat" : "Text",
                "Validation" : [],
                "Name" : "PASS",
                "Permission" : {
                    "Hidden" : [
                        "ac"
                    ]
                },
                "IsFormulaArg" : false,
                "MaxCharacters" : 100.0,
                "Label" : "PASS",
                "Widget" : "Dropdown",
                "DefaultPermission" : [],
                "Dropdown" : "me",
                "Score" : 1,
                "PermissionType" : "Hidden",
                "Id" : "me"
            },


            {
                "OutputFormat" : "dd/MM/yyyy",
                "NodeList" : {
                    "Score" : 2,
                    "Type" : "CellReference",
                    "Id" : "jdk2",
                    "Value" : null,
                    "CellMetadata" : {
                        "72uw" : "CreatedAt"
                    }
                },
                "Name" : "Date_Prepared",
                "Permission" : {},
                "IsFormulaArg" : false,
                "Required" : true,
                "Widget" : "Date",
                "Label" : "Date Prepared",
                "Score" : 2,
                "FormulaStr" : "CreatedAt",
                **"Formula" : "True",**
      …
0
So i have a user schema like this:

var user_schema = new Schema({
   username:{type:String,required: true, unique : true, trim: true},
   college:{type:String,required: true},
   password:{type:String,required: true, trim: true},
   email:{type:String,required: true, unique : true, trim: true},
   phone:{type:Number,required: true, unique : true, trim: true},
   dp:{type:String},
   tag:{type:String},
   description:{type:String},
   friends:[{type:String}],
   pending:[{type:String}],
   skills:{type:String},
   bucket:[{type:String}]
  });

Open in new window

and my objective is, to search the all the documents in the collection to get people based on the following conditions:

1. They should not be in the users' "friends" array.
2. They should not be in the users' "pending" array.
3. They should have the same "tag" (a string value) as the user.

So, basically I have to compare the users' fields ("friends","pending" and "tags"), with fields of all documents in the whole collection.

How do I do it, using mongoose (nodejs mongodb library)
0
I have to initialize an array to [](empty array) and then push user chose "tags" into it. This is my schema:

 var user_schema = new Schema({
   username:{type:String,required: true, unique : true, trim: true},
   college:{type:String,required: true},
   password:{type:String,required: true, trim: true},
   email:{type:String,required: true, unique : true, trim: true},
   phone:{type:Number,required: true, unique : true, trim: true},
   dp:{type:String},
   tags:[{type:String}],
   description:{type:String},
   skills:{type:String},
   bucket:[{type:String}]
 }); 

Open in new window

` and i have to initialize "tags" to [] and push user string values (user entered/chosen) every time the request is made to the API call.

I am using this line of code:

 stu_user.findOneAndUpdate(
   { _id: req.decoded.id },
   { $set:{tags:[]},$push: { tags: 'some chosen string'  } },
  function (error, success) {
         if (error) {
            console.log(error);
        } else {
            console.log(success);
        }
    });

Open in new window

But it's not working.
0
How to import collections from mongodb from cli?
0
OWASP: Threats Fundamentals
LVL 13
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Hey, This is just a decision-making problem. I am seeking for a well thought out answer.
I have to develop an android XMPP chat application, (the application also has a NodeJS server API, connecting to MongoDB and AWS S3 for picture uploads)

which will be better:

1. Having a "openfire" server on aws and connecting it to the android application and implementing an XMPP client on the android device using "smack" library.

2. Implementing a "xmpp-client" on NodeJS server side and scrape the results from this API to the Android device.
0
I am new to Angular and Firebase. I created an app where I am using email user and pass auth with Firebase auth.  When the user registers with a user and pass, two additional fields are added and populated in Firestore (Display Name and photoURL).  Those are populated by code in the auth.services.ts file.  So, when a user logs in again, it authenticates but then writes the Display name and photoURL again into the FIrestore.  I want to be able to add (or let the user add) the Display name and photo after they are logged in.  Here is what I have so far.  Any thoughts or direction?

FirestoreDB
FirebaseDB
Code in auth.services.ts
Auth Services
0
In MongoDb collection a DateTime field is stored in MST dateTime format for over 1 millions of record for a older record and now new records in utc dateTime format,
  Is there any cost effective query to update the date property in collections for those old recordsin MST dateTime
  (update the registered date format from MST to UTC format i.e. update time + 7:00 hr of each of these record)? We have MongoDb 3.3 version.
0
I'm having difficulty putting a complex(to me) aggregation query together for my data. Basically, here's the run down so everyone understands my conundrum.

I have two collections in this equation. "training_documents" and "users". Each user object has a key identified by name "trainings" which is an array of objects. Each object within this trainings array, contains 4 key/value pairs. An example of each object is below.

    {
    	"document": ObjectId('5a0350ad7df0977d94cffab6'),
    	"trainee": ObjectId('59e51a4b7df0977d94cff95d'),
    	"trainer": ObjectId('595fcc2e04cf707693257890'),
    	"completion_time": "2018-04-23T21:28:22.747Z"
    }

Open in new window


The users trainings array will contain many objects following the aforementioned format.

An example user data structure is below for reference.

   
 [
    	{
    		"_id": "5ad782283c55b056bcc39e3z",
    		"site": {
    			"site_id": "site1",
    			"site_name": "Site One"
    		},
    		"user_name": "jsmith",
    		"first_name": "John",
    		"middle_name": "A",
    		"last_name": "Smith",
    		"full_name": "John Smith",
    		"title": "Duh Boss...",
    		"email": "testuser@example.com",
    		"last_login": "2018-04-27T14:27:27.014Z",
    		"type": "full-time",
    		"active": true,
    		"__v": 0,
    		"badge_id": "000001780343232123",
    		"trainings": [
    			{
    				"document": ObjectId('5ae33622a766885a121b7362'),
    				"trainee": 

Open in new window

0
nodeJs and MongoDB
I Would like to  Create a dynamic navbar with mean stack a navbar that the admin can modify it navbar has
Main Categoy
Sub Categories title
sub category
example image https://prnt.sc/j3nxz7
0
Mongo 2.6.12

Not a mongo admin just trying to figure out an issue no one else wants to take on.

Mongo is flushing logs after 24 hours, where is that configuration set or better yet what command can I run against a collection to see the details of log retention?
0

NoSQL Databases

157

Solutions

305

Contributors

A NoSQL database provides a mechanism for storage and retrieval of data which is modeled in means other than the tabular relations used in relational databases. Motivations for this approach include: simplicity of design, simpler "horizontal" scaling to clusters of machines and finer control over availability. The data structures used by NoSQL databases (e.g. key-value, wide column, graph, or document) are specified from those used by default in relational databases, making some operations faster in NoSQL. Sometimes the data structures used by NoSQL databases are also viewed as "more flexible" than relational database tables.

Top Experts In
NoSQL Databases
<
Monthly
>