ravi13
June 29, 2020, 3:15am
#1
Hi!! Knime Experts…
Hope You are doing well.
I am facing issue in extracting data using MongoDB reader, can you correct me in writing query:
INPUT:
BUKRS
BLART
AMT
1100
RE
89
1200
RE
45
1101
ZE
78
1100
RE
41
1100
GE
23
1201
RF
98
1010
ZE
32
1100
RE
99
Requirement:
Just extract that much data where Column:BUKRS is 1100 & BLART: “RE”.
Output:
BUKRS
BLART
AMT
1100
RE
89
1100
RE
41
1100
RE
99
My Query :
I am using this query: {$or: [{“BUKRS”: “1100”}, {“BLART” : “RE”}]}
But this is satisfying only BUKRS condition, I want to satisfy both condition.
Thanks In advance.
Hi,
if you want it to satisfy both conditions, you have to use $and instead of $or.
Kind regards,
Alexander
1 Like
ravi13
June 29, 2020, 11:01am
#3
@AlexanderFillbrunn thanks for answer…
Will check & come back.
ravi13
June 29, 2020, 12:56pm
#4
@AlexanderFillbrunn
After changing to below, Empty data set is coming… & i have cross check there is data
{$and: [{“BUKRS”: “1100”}, {“BLART”:“RE”},{“BLART”: “KR”}]}
Hi,
Are you sure there is no typo in the data? If $or works, I think there is just no data with exactly those values.
Kind regards,
Alexander
2 Likes
ravi13
June 29, 2020, 3:26pm
#6
@AlexanderFillbrunn
I have checked. But $and works for 3 condition also ?
ravi13
June 29, 2020, 4:01pm
#8
@AlexanderFillbrunn
Ok thanks,
will again look into data.
system
closed
December 29, 2020, 4:12am
#9
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.