Go Premium for a chance to win a PS4. Enter to Win

x

NoSQL Databases

126

Solutions

246

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

Created a duplicate username entry in mongoose database and resulted in duplicated error. Now everytime I start server, I get this error:

(node:14839) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CastError: Cast to ObjectId failed for value "{ type: 'Buffer',
  data: [ 89, 243, 30, 231, 66, 69, 45, 56, 123, 65, 153, 72 ] }" at path "_id" for model "users"
(node:14839) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
0
Prepare for your VMware VCP6-DCV exam.
LVL 1
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

I am trying to update a dict with values searched from mongoDB whose parameters are taken from another dict. What I have till now is:

    lst = {'a':1}
    b={'Name':'name_1', 'Address':'Address_1'}
    lst.update(k:coll.find({"_id":id}{v:1})) for k,v in b.items()

What is the right way to do this procedure?
0
Hi, I have the following document and I want to delete all keys that are empty:

so it should delete the key year from first instance and build on second instance since is empty. I want the query to update all documents and clear that array of options of empty values.

{
    _id: 'sldkfjsldkf',
    name: "Red car",
    options: [
       {
          color: "red",
          year: "",
          build: "2000"
       },
       {
          color: "yellow",
          year: "1988",
          build: ""
       },
  ]

}
0
Hi,

Im new to CB and I have the following documents that have these fields: (among others)
  "_class": "com.wrapper",
  "dbProfile": {
         "operatorId": "3026",
          "profileType": "BEL_PR_LT"
}

I have several combinations of the pair dbProfile.operatorId/dbProfile.profileType among the documents but all have the _class the same.

I wanted to run a query that would display the all the possible combinations of dbProfile.operatorId/dbProfile.profileType only once (even if it appears more than once  - DISTINCT in SQL).

How would this look like in a CB query format? My bucket name is apoiu.

Tks,
J
0
I just installed ElasticSearch, MongoDB, GrayLog2 but getting an error and unable to access the web interface. Please, suggest any solution r

/etc/elasticsearch
# ls -lrtha
drwxr-x---.  2 root elasticsearch    6 Apr 24 16:29 scripts
-rwxr-x---.  1 root elasticsearch 2.6K Apr 24 16:04 logging.yml
-rwxr-x---.  1 root elasticsearch 3.2K Jul 20 05:05 elasticsearch.yml


/var/log/graylog-server/server.log

2017-07-20T07:50:36.694Z INFO  [CmdLineTool] Loaded plugin: Elastic Beats Input 2.2.3 [org.graylog.plugins.beats.BeatsInputPlugin]
2017-07-20T07:50:36.696Z INFO  [CmdLineTool] Loaded plugin: Collector 2.2.3 [org.graylog.plugins.collector.CollectorPlugin]
2017-07-20T07:50:36.699Z INFO  [CmdLineTool] Loaded plugin: Enterprise Integration Plugin 2.2.3 [org.graylog.plugins.enterprise_integration.EnterpriseIntegrationPlugin]
2017-07-20T07:50:36.700Z INFO  [CmdLineTool] Loaded plugin: MapWidgetPlugin 2.2.3 [org.graylog.plugins.map.MapWidgetPlugin]
2017-07-20T07:50:36.708Z INFO  [CmdLineTool] Loaded plugin: Pipeline Processor Plugin 2.2.3 [org.graylog.plugins.pipelineprocessor.ProcessorPlugin]
2017-07-20T07:50:36.709Z INFO  [CmdLineTool] Loaded plugin: Anonymous Usage Statistics 2.2.3 [org.graylog.plugins.usagestatistics.UsageStatsPlugin]
2017-07-20T07:50:36.813Z ERROR [CmdLineTool] Invalid configuration
com.github.joschi.jadconfig.ValidationException: Cannot read file elasticsearch_config_file at path /etc/elasticsearch/elasticsearch.yml. Please specify the correct …
0
Hi,

Please bear with me, my Mongo knowledge is minimal and my google foo has failed me after an hour or two.

I have data in Mongo that looks as follows:

{
    "_id" : ObjectId("xxxx"),
    "applicationData" : {
        "groups" : [
            "group1",
                  "group2",
        ],
        "status" : "ok"
    },
    "appid" : "UID0001",
}

{
    "_id" : ObjectId("yyyy"),
    "applicationData" : {
        "groups" : [
                  "group2"
        ],
        "status" : "ok"
    },
    "appid" : "UID0001",
}

From this I'm wanting to group by the content of "groups" and the appid an get a count - the result would be as follows:

group1  UID0001 1
group2  UID0001 2

One step further would be that I'd only like it to report where the "count" is greater than 1

How can I achieve this?

I guess, in SQL, it would be:

select groups, appid, count(*) from db having count(*) > 1

I'm not having much (any) success, further complicated with one of the values I'm wanting to group by is in an Array.

Thanks in advance
0
I am using php and mongoDb. I am new to mongoDb, but fine with php.  In my mongoDb database I have a  collection called 'users' with a number of fields such as firstname, lastname etc. There are a number of users.


I also have a field/collection in some users called web_links which contains an array.
ie: within my users document:
{
    "_id" : ObjectId("587af11ec09cf31a1955ed92"),
    "username" : "mike",
    "firstname" : "Mike",
    "lastname" : "Tester",
    "email" : "mike@test.com",
    "web_links" : [
        {
            "name" : "google",
            "link" : "https://google.com",
            "status" : "1",
            "added" : ISODate("1970-01-18T08:00:57.600Z")
        },
        {
            "name" : "yahoo",
            "link" : "https://yahoo.com",
            "status" : "1",
            "added" : ISODate("1970-01-18T08:00:57.600Z")
        }
    ]
}

I am trying to firstly update the status of an array item.
I have got as far as this ->

$name = 'google';
$newstatus = '0';

$this->database->users->updateOne(['_id'=>new MongoDB\BSON\ObjectId($userid)],['web_links.name'=>$name],['$set'=>['web_links.$.status'=>$newstatus]]);

This is returning the following error via firebug:
Uncaught exception 'MongoDB\Exception\InvalidArgumentException' with message 'First
 key in $update argument is not an update operator'.

I have tried to change $set to $push, but that is not the answer.

I would be very grateful for assistance …
0
I am learning Angular, Node, npm, deployd, mongodb, etc.  I am making my way through a book titled "Pro AngularJS" by Adam Freeman.

on page 120 I am attempting to prepare the data for a "real world" application called "sportsstore".

I was instructed to install a module called "deployd" which apparently is used for modelling  API's for web applications.

I did that and when I try to start start the "deployd" service I get an error:

C:\PROGRA~2\deployd>dpd -p 5500 sportsstore\app.dpd --mongod
starting deployd v0.8.9...
internal/child_process.js:289
  var err = this._handle.spawn(options);
                         ^

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (internal/child_process.js:289:26)
    at exports.spawn (child_process.js:380:9)
    at Object.exports.restart (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\lib\util\mongod.js:38:14)
    at Command.start (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\bin\dpd:149:16)
    at Command.listener (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\node_modules\commander\index.js:301:8)
    at emitOne (events.js:96:13)
    at Command.emit (events.js:188:7)
    at Command.parseArgs (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\node_modules\commander\index.js:617:12)
    at Command.parse (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\node_modules\commander\index.js:458:21)
    at Object.<anonymous> 

Open in new window

0
Hi,

I would like to know how to ensure primary key in the dynamo db. is there is any way to do that,,, Any example which can
help us.

roy..
0
I have a mongodb cluster running fine. It forces SSL by policy. DB serves content to frontend/web fine. I can connect to it via mongo shell and mongos fine.

I also have sensu up and running with no issues on any plugins accept the mongo plug in. Here is the mongo plugin I'm using
https://github.com/sensu-plugins/sensu-plugins-mongodb

It's called mongodb.py and here is an example of how sensu runs the script
./check-mongodb.py --ssl --host 10.0.0.1 --port 12345 --user=USER --pass=123456789 --action=connections

Which gives this error:
CRITICAL - General MongoDB Error: `ssl_cert_reqs` is not ssl.CERT_NONE and no system CA certificates could be loaded. `ssl_ca_certs` is required.

I'm not a python or SSL expert. And I'm a mongodb novice. If I had to guess this has something to do with python not finding or not liking a CA cert. The certs are all self signed internal only.  Maybe it's because it's self signed? It's really bizarre because again, everything else mongo and SSL related works fine. It's only something about this particular script that's failing.

Any help is appreciated.
0
Hello  ,

i'm new member here , so i say hi to everybody , i'm working on integration project of supervision ( monitoring ) . the Server is RHEL 6 & Redis server installed is 2.8 , redis server is running , but when i try to start my sensu server it generate a problem . "  unable to connect to redis server " in sensu-server log
0

NoSQL Databases

126

Solutions

246

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
>