Vishal Baid

Ranch Hand
+ Follow
since Jul 18, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vishal Baid

Leena Ruhela wrote:Thanks for sharing.
I have enrolled for MongoDB java developer online training this week. Still 6 weeks to learn more MongoDB concepts.



The Course is really very good. But the course provides just basic knowledge. But as you progress and practice you will get more deeper knowledge.
Just try to solve as much problem as you can and get more deeper knowledge. All the best ... :-)
9 years ago
Solution :

9 years ago
yupiii

I got the answer. I was trying this from last 5-6 hrs. Reading lot of things.
Now I got the solution which i want to share with you guys :



I know this is a small problem for lot of people. But As i am newbie. So for me its time for celebration. I mean to say near about achievement.
9 years ago
My Collection
> db.rec1.find().pretty()
{
"_id" : ObjectId("537b4d79f8b58b56f86d0af8"),
"carrierCode" : "AA",
"carrierName" : "Americal Airline Inc",
"timing" : [
{
"arrival" : {
"date" : 200514,
"time" : 1628
}
},
{
"depart" : {
"date" : 200514,
"time" : 2000
}
}
]
}

I want to change the value of depart time to 1800. For this I am using following :
db.rec1.update({"carrierCode":"AA","timing.depart.time":2000},{$set:{"timing.$.depart":{"time":1800}}})

But this query give me undesired result.

> db.rec1.find().pretty()
{
"_id" : ObjectId("537b4d79f8b58b56f86d0af8"),
"carrierCode" : "AA",
"carrierName" : "Americal Airline Inc",
"timing" : [
{
"arrival" : {
"date" : 200514,
"time" : 1628
}
},
{
"depart" : {
"time" : 1800
}
}
]
}

In this collection, depart time is change. But this remove the date field. Please help me guys.
Just now i completed m101j mongoDB course doing some practice work for a project.

Thanks in advance.
9 years ago
Hi,
The query for the update will look like this :
db.rec.update({"carrierCode":"AA"},{$push:{"delayTime":{"arrival":{"date":"19811","times":5257}}}})

Before you run this query, I want to inform you delayTime should be array not collection.

Please guys, If I am wrong, please let me know.
This will help in improving myself.
Suggestions most welcome.

Regards,
Vishal
9 years ago
If you want to do specialization in MongoDB, doing this certification is big step. MongoDB is the most popular NoSQL database right now.
So you can go ahead with this certification. It definitely benefit you ...
All the best in Advance..
9 years ago
Hi Guys !
I am new In Hadoop. But I heard lot abut hadoop.
My Manager want is to use in a project. So I check Hadoop and I find very interesting.

But I want to know that Will Hadoop work for Small database of about 1-2 GB.

Right know we all are using MYSql Database.

Will hadoop work for us ?
Please Reply. Thanks in advance.
10 years ago

kk pournami wrote:I have an SCJP test Question.The code is given below.

when i run this code i am getting StringIndexOutOfBoundsException.I don't know why.Can anybody help me........






Hi KK



Check the bold letter. Now I think understand Why you are getting error ?
Or Check post and pre decrement on google.
I am using MYSQL.

EMPID is not auto-incremant. In ofbiz framework, the primary key Empid is random number.
Not in an order that is why i am facing this issue.

Martin Vajsar wrote:First of all, how often is the query run, how long it takes now and how much do you need it to improve?

If there isn't an index on the EMPID column, create one. Since you're selecting just a few rows, the database should use the index and it should be quite fast.

The query itself is so simple that there isn't much to optimize. However, you should explicitly name columns instead of specifying SELECT *. It won't help much, but (depending on the database, your indexes and network) it might be a bit faster, especially if you select more than just a few rows and/or there is an index containing all columns you're selecting.



Hi Thanks for your reply.

Their EMPID is a primary key. The index is not defined properly. First Employee ID is 1000 the n may be next one is 10010. So no proper indexing.
Problem is that for finding the 10th lowest EMPID, ORDER BY do the ordering of whole table first then only give the 10th row. If the number of rows are 100 Million then it is taking abt 1 mins.
The process takes lot of time. So I want someone give me some idea who to make the query work fast.

Thanks in advance.
Hi All.

I want to optimize a query

SELECT * FROM EMPLOYEE ORDER BY EMPID ASC LIMIT 9,1.

This Query will give me the 10th LOWEST EMPID in the table.
But if the number of rows is abut 100 million the query have a bad performance.

So please help me on this.
I give one example

let Say
http://abc.com
is the domain.

Can i do something like
http://sometext.abc.com.

So that both run on different port number.

Thanks is advance all ranchers.
Really best website for asking question and finding something new also.
11 years ago
On my local system two application is running on different port number. Can I access both the application on server with the same domain name ?
11 years ago
Sorry Now the code is complete

11 years ago
JSP

mk yadav wrote:hi,
i want to implement breadcrumb but i do not know how can i do this so please give me any link for knowing about breadcrumb.



Check the below file. You you need to do certain change according to your need.
11 years ago
JSP