Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

MongoDB send Values

  • FrankyQuest
  • FrankyQuest's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 10 months ago #216847 by FrankyQuest
MongoDB send Values was created by FrankyQuest
Hello Community,
i have a little issue
at the end of the survey i have a question (results) which displays the result based on the answers. I have 5 question group so i have multiple ifs but basically looks like this

"Science:" {risScience} (risScience is the sum of the assestments value of the questions in the science group of questions)
"Medicine:" {risMedicine} ( same as science)
(if(risScience > risMedicine, "Science faculty fits for you")

so what i need to do: is to store/save the string "science faculty fits for you" in my mongoDB server
i have multiple ifs, a help will be really appreciated.
Thank you.

i will add the lss of my survey if someone wants to give it a look.
 

File Attachment:

File Name: limesurvey... (3).lss
File Size:55 KB
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #216849 by holch
Replied by holch on topic MongoDB send Values
Use a equation type question, put the equation there and it will be stored in the Limesurvey database.

Or do you want to store it in a different database? Then you need to find a different solution either via API or pass it to an external, custom script via End URL.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
2 years 10 months ago #216856 by jelo
Replied by jelo on topic MongoDB send Values

Or do you want to store it in a different database? Then you need to find a different solution either via API or pass it to an external, custom script via End URL.

If MongoDB is no mistype (sometimes that gets mixed up with MariaDB), the treadstarter means an external database.  LimeSurvey is not supporting MongoDB as an application database.
 

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #216862 by holch
Replied by holch on topic MongoDB send Values

If MongoDB is no mistype (sometimes that gets mixed up with MariaDB), the treadstarter means an external database. LimeSurvey is not supporting MongoDB as an application database.


That is why I asked. I first thought of MariaDB as well, because somehow the post read as if they want to store the calculations in the LS Database, but then I noticed that it was specifically MongoDB, which confused me.

Let's see if OP explains a little bit more about what he is trying to do.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • FrankyQuest
  • FrankyQuest's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 10 months ago #216865 by FrankyQuest
Replied by FrankyQuest on topic MongoDB send Values
Yes i need to save it on a different database which is MongoDB, our professor gave to us credentials to use it, i just need to save them on MongoDB, so you say i cannot someway use MongoDB as external DB?
The topic has been locked.
More
2 years 10 months ago #216874 by jelo
Replied by jelo on topic MongoDB send Values

so you say i cannot someway use MongoDB as external DB?

LimeSurvey isn't supporting MongoDB as an application database. The approach to store data into an external MongoDB is not dependent on Limesurvey.,
So you need to learn a bit Javascript and look up solutions from any other web-application communicating with MongoDB.

You have two tasks:
1.) How to get values of LimeSurvey into Javascript.
2.) How to transfer data from Javascript into MongoDB.
Only the first task is a LimeSurvey topic. You find a lot of forumposts about that topic.
Simplest form is  var myVar = '{Qcode.NAOK}'; to get an answer of an question into Javascript.

There are other approaches than via Javascript. So first you need to decide what technology you want to use to communicate with MongoDB.
Perhaps you get the answer of a MongoDB user here. But that will be a lot harder than in a forum about MongoDB.

 

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago - 2 years 10 months ago #216896 by holch
Replied by holch on topic MongoDB send Values
If it is for saving data collected with Limesurvey into a different database, then this is up to you.

You need to find a way to get the data from Limesurvey into your own script which writes it into your database.

There are a couple of ways you could do that, e.g. via End URL, or via API, or if you have access to the LS database, you can draw it directlly from there.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 2 years 10 months ago by holch.
The topic has been locked.
  • FrankyQuest
  • FrankyQuest's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 10 months ago #216898 by FrankyQuest
Replied by FrankyQuest on topic MongoDB send Values
Thank you very much, we tried as you suggested but unsuccessfully so we want to try with MySQL, as far as you know there is way you can suggest to us to store that string into a MySQL database ?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #216900 by holch
Replied by holch on topic MongoDB send Values
Where is the problem? What did not work? How did you try to retrieve the string? How is the string stored in Limesurvey?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • FrankyQuest
  • FrankyQuest's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 10 months ago #216904 by FrankyQuest
Replied by FrankyQuest on topic MongoDB send Values
connect to mongo db via javascript the first step basically
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #216923 by DenisChenu
Replied by DenisChenu on topic MongoDB send Values
And ? Why you contact us ?

You can do what you want with javascript : we don't really care. Is this related to LimeSurvey or not ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose