[MongoDB]: Aggregation with $unwind for querying subdocuments in an Array
[ root @ dbvesitydotcom : ~ ] mongo MongoDB shell version: 2.6.5 connecting to: test > > > use dbversity_db switched to db dbversity_db > > db.mycol.insert({L1F1:”val1″,L1F2:[{L2F1:”val2″,L2F2:”val3″,L2F3:[{L3F1:”val50″, L3F2:”val51″,L3F3:”val52″},{L3F1:”val53″, L3F2:”val54″,L3F3:”val55″}]},{L2F4:”val4″,L2F5:”val5″}]}) WriteResult({ “nInserted” : 1 }) > > > db.mycol.find().pretty() { …
Processing Apache logs using a Python script
[root@localhost apache2]# cat ../apache.py __author__ = ‘root’ #!/usr/bin/python import re import sys from datetime import datetime, date, timedelta from collections import Counter # Define the day of interest in the Apache common log format. try: daysAgo = int(sys.argv[1]) except:…
Python script to list all files, directories in a given path
[root@localhost utils]# pwd /root/Documents/dbversity/utils [root@localhost utils]# [root@localhost utils]# [root@localhost utils]# ll -lhtr total 20K -rw-r–r–. 1 root root 0 Jun 8 14:24 _init_.py -rw-r–r–. 1 root root 95 Jun 8 14:35 new_function.py -rw-r–r–. 1 root root 77 Jun 8 14:54…
MongoDB ahead of Cassandra and Couchbase for scalability – report
MongoDB has raced ahead of its NoSQL database competitors Cassandra and Couchbase for scalability, according to tests using the Yahoo Cloud Serving Benchmark (YCSB). The research, carried out by benchmarking and performance-testing firm United Software Associates (USA Inc), involved evaluating…
[MongoDB]: Overview
• A Document database • Developed by MongoDB Inc. • Latest version is 3.0.2 (released on April 9, 2015) • Runs on most platforms such as Red Hat Enterprise, CentOS, Fedora Linux, Ubuntu, Debian, Linux, OS X, Windows • Supports…
MongoDB: windows and linux installation
You can download MongoDB package from below URL : https://www.mongodb.org/downloads Windows Package : https://www.mongodb.org/dr/fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.0.3-signed.msi/download Linux Vesion : https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.0.3.tgz curl -O http://downloads.mongodb.org/linux/mongodb-linux-x86_64-3.0.1.tgz Server End : Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\sahithi> C:\Users\sahithi> C:\Users\sahithi>cd C:/…
[MongoDB]: bsondump – how it works !
[root@myhostname bin]# ./mongo MongoDB shell version: 2.4.11 connecting to: test > > use mydb switched to db mydb > > > for(var i = 1; i <= 10000 ; i++){db.test_collection.insert({“_id” : i , “title” : “How do I create manual…
[MongoDB]: Model Tree Structures
To model hierarchical or nested data relationships, you can use references to implement tree-like structures. The following Tree pattern examples model book categories that have hierarchical relationships. Model Tree Structures with Child References The Child References pattern stores each tree…
MongoDB : Unity JDBC
JDBC Driver for MongoDB® The JDBC driver for MongoDB runs SQL queries against MongoDB for any Java application that supports JDBC. SQL support includes functions, expressions, aggregation, and joins including for collections with nested objects and arrays. See the features…