MongoDB Aggregation

349 views
Skip to first unread message

priyanka....@flowian.com

unread,
Aug 18, 2017, 2:32:47 AM8/18/17
to Fujitsu RunMyProcess Developer Community
Hello Team,

I do have date timstamp in my collection.
I want to fetch month and year from timstamp using $month and $year aggregations of mongoDB. But the $month and $year are not working in the aggregation queries of RMP.
Please guide us how can we fetch month and year of timstamp.
Following is the aggregation query-

var options = {};
var my_pipelines = [
{
"$project" : {"month": { "$month" :"$timstamp" }}
}
];

id_collection.aggregateCallback(my_pipelines,options,callbackSuccess,callbackFailure);
function callbackSuccess(result) {
alert(JSON.stringify(result));
}
function callbackFailure(result) {
alert("Error");
}

priyanka....@flowian.com

unread,
Aug 21, 2017, 1:02:14 AM8/21/17
to Fujitsu RunMyProcess Developer Community, priyanka....@flowian.com
Hello Team,

Any updates regarding this issue?

Thanks
Regards,
Priyanka

Dipen Raval

unread,
Aug 23, 2017, 5:26:51 PM8/23/17
to Fujitsu RunMyProcess Developer Community, Priyanka Patgaokar
Hi Priyanka,

Apologies for delay in response.

Are you  storing value of timestamp in collection as Date object or String object?
we are waiting for your response.

Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/91a27644-a4bd-4107-b66a-6d1f73af49ad%40runmyprocess.com.

priyanka....@flowian.com

unread,
Aug 24, 2017, 12:49:13 AM8/24/17
to Fujitsu RunMyProcess Developer Community, priyanka....@flowian.com
Hello Team,

I am storing timestamp in numeric format in my collection.

Thanks
Regards,
Priyanka

priyanka....@flowian.com

unread,
Aug 24, 2017, 1:23:57 AM8/24/17
to Fujitsu RunMyProcess Developer Community, priyanka....@flowian.com
Hello Team,

As per my knowledge we can not specify the type of data we are storing in the MongoDB from RMP(like String, Number, Date). So What we are doing is that we are storing the timestamp in the Number format(by default it gets store in the number format).

How can we specify that the timestamp what we are storing in the collection is of type Date.

Thanks & Regards,
Priyanka

priyanka....@flowian.com

unread,
Aug 28, 2017, 8:01:06 AM8/28/17
to Fujitsu RunMyProcess Developer Community, priyanka....@flowian.com
Hello Team,

Any updates on this issue?

Thanks
Regards,
Priyanka

Prachi Chandak

unread,
Aug 28, 2017, 8:43:56 AM8/28/17
to Fujitsu RunMyProcess Developer Community, Priyanka Patgaokar
 Hi Priyanka,
 
As per my understanding, you want to extract 'month' and 'year' from the date stored in collection.
Currently you are storing the date(timestamp) in numeric format (1503917844). If you want to extract 'month' and 'year' from date then store the date in 'dd-MM-yyyy' format in collection using 'String date variable' of date widget.  Please refer the attachment. (date_WI)

This will fulfill your requirement. Please correct me if I misunderstood.

Feel free to contact us for any further query.

Thanks & Regards,
Prachi Chandak
Fujitsu RunMyProcess Support

Regards,
Priyanka

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
date_WI.PNG

Dipen Raval

unread,
Aug 29, 2017, 4:37:48 PM8/29/17
to Fujitsu RunMyProcess Developer Community, Priyanka Patgaokar
Hi Priyanka,

Good Day.

Could you please confirm that issue has been clarified?
Please don't hesitate to contact us for any further query.


Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support

On Mon, Aug 28, 2017 at 6:13 PM, Prachi Chandak <pcha...@runmyprocess.com> wrote:
 Hi Priyanka,
 
As per my understanding, you want to extract 'month' and 'year' from the date stored in collection.
Currently you are storing the date(timestamp) in numeric format (1503917844). If you want to extract 'month' and 'year' from date then store the date in 'dd-MM-yyyy' format in collection using 'String date variable' of date widget.  Please refer the attachment. (date_WI)

This will fulfill your requirement. Please correct me if I misunderstood.

Feel free to contact us for any further query.

Thanks & Regards,
Prachi Chandak
Fujitsu RunMyProcess Support

On Mon, Aug 28, 2017 at 5:31 PM, <priyanka.patgaokar@flowian.com> wrote:
Hello Team,

Any updates on this issue?

Thanks
Regards,
Priyanka

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/95e40026-85e6-4195-b8b8-ee2393af8e40%40runmyprocess.com.

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

Prachi Chandak

unread,
Aug 31, 2017, 7:45:34 PM8/31/17
to Fujitsu RunMyProcess Developer Community, Priyanka Patgaokar
Hi Priyanka,

Awaiting for your response.

Thanks & Regards,
Prachi Chandak
Fujitsu RunMyProcess Support

On Wed, Aug 30, 2017 at 2:07 AM, Dipen Raval <dra...@runmyprocess.com> wrote:
Hi Priyanka,

Good Day.

Could you please confirm that issue has been clarified?
Please don't hesitate to contact us for any further query.


Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support
On Mon, Aug 28, 2017 at 6:13 PM, Prachi Chandak <pcha...@runmyprocess.com> wrote:
 Hi Priyanka,
 
As per my understanding, you want to extract 'month' and 'year' from the date stored in collection.
Currently you are storing the date(timestamp) in numeric format (1503917844). If you want to extract 'month' and 'year' from date then store the date in 'dd-MM-yyyy' format in collection using 'String date variable' of date widget.  Please refer the attachment. (date_WI)

This will fulfill your requirement. Please correct me if I misunderstood.

Feel free to contact us for any further query.

Thanks & Regards,
Prachi Chandak
Fujitsu RunMyProcess Support

priyanka....@flowian.com

unread,
Sep 1, 2017, 5:05:15 AM9/1/17
to Fujitsu RunMyProcess Developer Community, priyanka....@flowian.com
Hello Team,

I have stored the date in 'dd/MM/yyyy' format.But still it is not working.

Thanks
Regards,
Priyanka

Prachi Chandak

unread,
Sep 7, 2017, 8:12:01 PM9/7/17
to Fujitsu RunMyProcess Developer Community, Priyanka Patgaokar
Hi Priyanka,

I have provided you the alternate solution to store date and extract month and year from date(yyyy-MM-dd).
Sorry I forgot to inform you that $month or $timestamp are functionalities in MongoDB. Here, it will not be supported.

Alternatively, you can store your dates and the extract month and year from collection using functions such as getMonth() or getYear() or vice-versa.

Please feel free to contact us for further queries if any.  

Thanks & Regards,
Prachi Chandak
Fujitsu RunMyProcess Support


Thanks
Regards,
Priyanka

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

Dipen Raval

unread,
Sep 10, 2017, 2:22:31 AM9/10/17
to Fujitsu RunMyProcess Developer Community, Priyanka Patgaokar
Hi Priyanka,

Good Day.

Could you please confirm that issue has been clarified?
Please don't hesitate to contact us for any further query.
  

Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support

On Fri, Sep 8, 2017 at 5:41 AM, Prachi Chandak <pcha...@runmyprocess.com> wrote:
Hi Priyanka,

I have provided you the alternate solution to store date and extract month and year from date(yyyy-MM-dd).
Sorry I forgot to inform you that $month or $timestamp are functionalities in MongoDB. Here, it will not be supported.

Alternatively, you can store your dates and the extract month and year from collection using functions such as getMonth() or getYear() or vice-versa.

Please feel free to contact us for further queries if any.  

Thanks & Regards,
Prachi Chandak
Fujitsu RunMyProcess Support

On Fri, Sep 1, 2017 at 2:35 PM, <priyanka....@flowian.com> wrote:
Hello Team,

I have stored the date in 'dd/MM/yyyy' format.But still it is not working.

Thanks
Regards,
Priyanka

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/e8ee3db3-45ac-461e-9d3a-13f56db70d10%40runmyprocess.com.

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

priyanka....@flowian.com

unread,
Sep 11, 2017, 12:37:25 AM9/11/17
to Fujitsu RunMyProcess Developer Community, priyanka....@flowian.com
Hello Team,

Issue has been clarified.Thanks for your help.

Regard,
Priyanka

Reply all
Reply to author
Forward
0 new messages