VikasKumar Gupta

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

Recent posts by VikasKumar Gupta

Dear Friends,
I tried creating replica set in mongodb. All went fine but after creating "primary" when i added two other nodes to make them secondary, these nodes got stuck in "STARTUP".  I tried adding these nodes using IP address and hostname but no luck.
If any one knows solution to it then please let me know or any pointers or hints to solve this issue will also help.

Regards,
Vikas
4 years ago

henry Bbosa wrote:I cant Download too. I am in Uganda. Is Africa also in BlackList



Try using VPN and connect to some other country and try downloading it.

Regards,
Vikas
4 years ago
Hello,
I am able to solve this issue.
Normally mongodb gets installed with user "mongod", so ownership has to be changed to mongod by using following command.

"sudo chown mongod:mongod /etc/key". then I was able to start the mongodb.

Regards,
Vikas
4 years ago
Dear Friends,
I want to create replica set and for that I had to configure mongodb for internal authentication. I did as per the mongodb documentation. I created key file and gave "600" access to file. I am using root user to start the server but getting following error.

2019-03-17T10:40:28.195+0300 I ACCESS   [main] error opening file: /etc/key: Permission denied



I don't understand why for opening file user root is getting permission denied error though I've give read and write access to this file for user root.

Need urgent help to sort this issue.

Regards,
Vikas
4 years ago
Dear Tan,
I think your collection has huge data and your search query is also returning huge data. Please check if you collection is indexed properly. Try to count records in your query and if count shows huge no of records then try to use skip and limit to get data data in batch.

Regards,
Vikas
4 years ago
Dear Blitz,
findOne done not return cursor but single document. "Find" returns cursor.  In case "findOne({"query"}) " is not able to fins any matched document then it returns "null".

Regards,
Vikas
4 years ago
Dear Joseph,
I am not expert of MongoDB but trying to reply as per my knowledge.
* Find returns the cursor, which may have single or multiple records as per your search query.
* Skip and Limit is used for server side pagination.

As per my knowledge "skip and limit" should be used for pagination.

Regards,
Vikas
4 years ago
Hi,
I was able to fix this issue by making my query dynamic and it is running faster than oracle.
5 years ago
Hello Friends,
I installed Drupal8 using XAMPP. Installation was done properly and I got the main Admin page but on that page whatever link I click I get "Page not Found" error. I closed the page and restarted apache server now I get the login page. As soon as I click on login link I get "Object not found error".
I checked rewrite module and it is enabled. I checked "RewriteBase" and it is properly set.
Not able to understand where the problem is. It would be a great help if someone knows the reason/solution to this problem or any pointer will also help.

Regards,
Vikas

Campbell Ritchie wrote:So it works without the constructor call from the command line and not from Eclipse? How strange.
Are you using the same version of Java® for both? Get the version from the command line with java -version and for Eclipse from Project→Properties.



Yes, I am using the same version of java at both the places. I did not say without constructor but what i meant was in command line I used the constructor without argument and through eclipser I just passed the argument as 'null' to the constructor.

command line i used : ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");

Eclipse : ScriptEngine engine = new ScriptEngineManager(null).getEngineByName("nashorn");
6 years ago

Tim Moores wrote:

Do we need to register script engine first and then use it?


No. As I said, the above code works fine for me.

If i run it through eclipse then it is not working but if i running as stand-alone java program through command line it is working.


Good to hear you sorted it out. Just another reminder that IDEs are not the same runtime environment one would normally encounter. I've no idea why that happens, though.



Issue is sorted now. When i am calling it from eclipse, I have to pass "null" in "ScriptEngineManager" constructor and it starts working.

eg : ScriptEngine engine = new ScriptEngineManager(null).getEngineByName("nashorn");

Thanks to all for kind help.

Regards,
Vikas
6 years ago

VikasKumar Gupta wrote:

Tim Moores wrote:Something odd must be going on. The code runs fine for me with both "nashorn" and "javascript", as it should.

Which Java version are you using?



java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)

Do we need to register script engine first and then use it?



One weird thing i noticed. If i run it through eclipse then it is not working but if i running as stand-alone java program through command line it is working.
Any clue on this?

Regards,
Vikas
6 years ago

Tim Moores wrote:Something odd must be going on. The code runs fine for me with both "nashorn" and "javascript", as it should.

Which Java version are you using?



java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)

Do we need to register script engine first and then use it?
6 years ago
I used following code to get register scripts and I got null.

List<ScriptEngineFactory> factories = manager.getEngineFactories();
System.out.println(factories.size());

output is : 0.

Not able to understand what is wrong.

Regards,
Vikas
6 years ago