[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

MongoDB

136

Solutions

255

Contributors

MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc. and is free and open-source, published under a combination of the GNU Affero General Public License and the Apache License.

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

Sign up to Post

A new API requires us to receive about 45kb of information per row (record) and save this in a database, we see think about 700GB of data will be added PER year. The table is simple with 50 columns or fields. We are not sure if this is a job for MongoDB or MySQL. The setup must be able to scale horizontally, table will also be queried and searchable . About 1000 transactions per second.
0
Acronis True Image 2019 just released!
LVL 1
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Does MariaDB & MongoDB (I mean the Enterprise Edition) have
commercial support (just like RedHat Linux has while CentOS
is user-community support only)?

Concern is if there are security vulnerabilities (which may result
in data leaks) or DB corruption/integrity.  I've heard of banks
using MariaDB but I'm not sure if they house critical data but
I certainly would not want to house critical data on databases
that are non-commercially supported or even if it's commercially
supported by vendors with low track record (I deem Oracle &
MS as good-track record DB vendors).

I think MongoDB is a non-relational (ie network) DB.

Concern is if a database is hosting critical data, user-community
support is not non-committal & patches are not released as
regularly as commercially-supported softwares, though it's
noted MS release patches monthly, much more than any other
commercial vendors
0
I have two collection
Name and address which i exported as json from relation database

I want to merge that two collection as below how can i do that.


Thanks

I
{
    "_id" : ObjectId("5bba4cadb20b7e2f3c1436fd"),
    "o_id" : 5,
    "surname" : "sam",
    "firstname" : "sam",
    "created_date" : "2018-10-07",
    "address" : {
        "address1" : "177 road",
        "city" : "MI"
    }
}
0
Hello,

How kill session through opsmanager ?

Thank you


Regards
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
I know there's a ton of questions around date/time storage and formatting, but I'm struggling to get the right approach. My app is a Node.js app with Express using mongoose with a MongoDB backend. I'm using moment.js to format my date/times.

The schema in question looks like:

const stateSchema = new mongoose.Schema({
  changed: {
    type: Date,
    default: new Date()
  }
});

Open in new window

Based on the docs, I was expecting the date to be stored in UTC by default, but instead I see this:
changed: 2018-08-15 17:26:14.499

Open in new window

I'm displaying the date/time with something like (pug):

p= `Changed: ${moment(state.changed).format('MMMM Do YYYY, h:mm:ss a')}`

Open in new window

On localhost, the app shows "August 15th 2018, 5:26:14 pm" but on the hosted Heroku app I get "August 15th 2018, 10:26:14 pm." I am expecting "August 15th 2018, 5:26:14 pm" because I'm opening the Heroku app in the same timezone, but it looks like it's giving me the server timezone.

What should I do to make sure the date/time shows up in the client's local timezone?
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
I am trying to install MongoDB on my hosted Linux box and getting this error.

I cannot seem to get it corrected after trying many different forum solutions.

Anyone have any thoughts?

My hosted system specs:
Operating system Debian Linux 8
Kernel and CPU Linux 3.16.0-5-amd64 on x86_64

 The following packages have unmet dependencies:
 mongodb-org : Depends: mongodb-org-server but it is not going to be installed
               Depends: mongodb-org-mongos but it is not going to be installed
               Depends: mongodb-org-tools but it is not going to be installed
 unifi : Depends: mongodb-server (>= 2.4.10) but it is not going to be installed or
                  mongodb-10gen (>= 2.4.14) but it is not installable or
                  mongodb-org-server (>= 2.6.0) but it is not going to be installed
         Depends: mongodb-server (< 1:3.6.0) but it is not going to be installed or
                  mongodb-10gen (< 3.6.0) but it is not installable or
                  mongodb-org-server (< 3.6.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Open in new window


T.I.A.!
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
Creating Active Directory Users from a Text File
LVL 8
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

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
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
How do MongoDB and Active Directory go together?

I have a small bit of exposure to MongoDB and  Active Directory as well. But is there so synergy of using them together?

Curious..

Thanks
0
hi,

how DB2 work with MongoDB ?
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
hi,

what is the solution to integrate Oracle with Mongo DB? data flow between them ?
0
hi,

anyone know how to intergrate MariaDB and Mongo DB so that they work together well ?

how about MariaDB and hadoop?
0
Choose an Exciting Career in Cybersecurity
Choose an Exciting Career in Cybersecurity

Help prevent cyber-threats and provide solutions to safeguard our global digital economy. Earn your MS in Cybersecurity. WGU’s MSCSIA degree program was designed in collaboration with national intelligence organizations and IT industry leaders.

hi,

anyone know how to intergrate MS SQL and Mongo DB so that they work together well ?

how about MS SQL and hadoop?
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 vs. Postgres DB.  Can you anyone pointed pros and cons?  And from the personal experience advice?
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
Hi There,

I have a mongodb aggregate query in PHP that is throwing an error and I can't see what I've missed in the syntax.

Versions are
mongodb =  3.6
PHP  = 7.1
mongo PHP driver = 1.3.1-1


 The query in mongo shell works and looks like this:

db.products.aggregate(
	[
		{
			$match: {
			    download_Date : {'$gte' : 20180205 }
			}},
		{
			$sort: {
			download_Date: 1 }
		},
		{
			$group: {
			 _id: "$cw_product_id", batch: { $last : "$download_Date" }
	        }},
	]

Open in new window


My code in PHP fails and  looks like

$command = new MongoDB\Driver\Command([
    'aggregate' => 'products',
    'pipeline' => [    
        ['$match' =>  [ 'download_Date' => ['$gte' => $batch ]]],
        ['$sort'  => [  
            'download_Date' => 1
        ]],
    ['$group' => [ 
        '_id' => [ '$cw_product_id', 'batch' => ['$last' => '$download_Date'] ],
        ]],   
    ],
        'allowDiskUse' => true, 
        'cursor' => new stdClass, 
    ]);

Open in new window


The error I receive when running the php script is

           
PHP Fatal error:  Uncaught MongoDB\Driver\Exception\RuntimeException: Unrecognized expression '$last'

Open in new window

I've pulled it apart and put it back together so many times, a fresh pair of eyes is needed to spot the obvious.  

Thanks in advance,

Rick
0
Hi,

I have a text file which has multiple json rows in it.

What I need to do is the following:-

1. Read thru the file
2. Select only certain elements not all, remap to a new name for example AuthenticationId could be AuthId
3. Ingest in to MongoDB as JSON

How can this be achieved in Python?

{"AuthenticationId":"997","CommandLine":"C:\\Windows\\system32\\wbem\\wmiprvse.exe -secured -Embedding","ConfigBuild":"1007.3.0005907.1","ConfigStateHash":"3163607488","EffectiveTransmissionClass":"3","Entitlements":"15","ImageFileName":"\\Device\\HarddiskVolume3\\Windows\\System32\\wbem\\WmiPrvSE.exe","ImageSubsystem":"2","IntegrityLevel":"16384","MD5HashData":"1df2fc82b861bc9612657d1661e9ae33","ParentAuthenticationId":"997","ParentProcessId":"1627804482161","ProcessCreateFlags":"16","ProcessEndTime":"","ProcessParameterFlags":"24577","ProcessStartTime":"1512962460","ProcessSxsFlags":"64","RawProcessId":"9276","SHA1HashData":"1aa3fda50123dd14a055b4d6601beedead69fe11","SHA256HashData":"835f2a94e47830b06654e484bf7a1cc0b9882f579716dca198e32d22218a07e5","SourceProcessId":"1627804482161","SourceThreadId":"39913451443946","TargetProcessId":"1756187997441","TokenType":"2","UserSid":"S-1-5-19","aid":"2bc82f8878df4b9f7712273e755a93be","aip":"105.255.135.108","cid":"99cdff8f89af458d858c3d6b3e312e11","event_platform":"Win","event_simpleName":"ProcessRollup2","id":"4ff73eae-de22-11e7-a0dd-06e913674db2","name":"ProcessRollup2V6","timestamp":"1512962460994"}

Open in new window



Open in new window

0

MongoDB

136

Solutions

255

Contributors

MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc. and is free and open-source, published under a combination of the GNU Affero General Public License and the Apache License.

Top Experts In
MongoDB
<
Monthly
>