Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongodb Integration #61

Closed
wants to merge 31 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fb9cdb3
feat: add helpers for cassandra
Nov 2, 2020
01d375f
wip: make connection storage agnostic so it works for generic storage…
Nov 3, 2020
7e6dea0
feat: import cassandra models / adapters
Nov 3, 2020
2f86141
refactor: migrateAndStartServer.sh
Nov 4, 2020
07d3f0f
Merge branch 'master' into issue34-cassandra
Nov 19, 2020
ccfbb94
wip: cassandra integration into test-setup
Nov 19, 2020
ddbdb4f
fix: migration path in cassandra setup
Nov 20, 2020
87655a7
fix: index - init connection at the beginning
Nov 23, 2020
b0e9925
feat: fixes to cassandra helpers
Nov 23, 2020
d53bf7c
add instances for mongodb
wunderbarr Dec 1, 2020
57a2584
set storage handler for all data models
wunderbarr Dec 1, 2020
01e7c16
fix: enclose value in qoutes if type includes String (also for array)
Dec 2, 2020
12397d8
chore: rename _in -> in
Dec 8, 2020
cf1646d
Merge branch 'master' into issue34-cassandra
Dec 8, 2020
3a18f02
feat:searchAPI for mongoDB
wunderbarr Dec 9, 2020
923d131
feat: add includeCursor functionality
Dec 9, 2020
5f66edf
feat: readAllCursor
wunderbarr Dec 14, 2020
90a34a7
feat: cursor based pagination for mongoDb
wunderbarr Dec 16, 2020
9e08aa9
feat: add bulkAddCsv method for MongoDb & support array type attribut…
wunderbarr Dec 16, 2020
29df6ac
association
wunderbarr Feb 12, 2021
01dc1d5
refactor: clean logs
wunderbarr Mar 16, 2021
c51f09d
refactor: clean code
wunderbarr Mar 17, 2021
d4956e4
fix: lazy loading for resolvers in server.js
wunderbarr Mar 18, 2021
5fac9f7
fix: assign resolvers after initialization of storage handlers
wunderbarr Mar 18, 2021
0acfe40
fix: regex operator in mongodb
wunderbarr Mar 19, 2021
9841f20
Merge branch 'localtest' of https://github.com/Zendro-dev/graphql-ser…
wunderbarr Mar 19, 2021
884ea66
Merge branch 'master' into issue34-cassandra
coeit Mar 25, 2021
716d348
Merge branch 'issue34-cassandra' into localtest
wunderbarr Mar 25, 2021
f80dc09
fix: rename acc into connectionInstances for cassandra
wunderbarr Mar 25, 2021
e50a3bd
fix: connect to cassandra client by getConnectionInstances method in …
wunderbarr Mar 25, 2021
591ceea
fix: assign connection to cassandra client
wunderbarr Mar 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: clean logs
wunderbarr committed Mar 16, 2021
commit 01dc1d5816204815e5dd23b94a7c481381ef748a
88 changes: 87 additions & 1 deletion queries.txt
Original file line number Diff line number Diff line change
@@ -115,4 +115,90 @@ mutation{
# accession_id
# }
# }
# }
# }

mutation{
addFood(food_id:"1", food_name:"pork", addAnimals:[2,5]){
food_id
animal_ids
}
}

mutation{
addFood(food_id:"2", food_name:"fish", addAnimals:[2,5]){
food_id
animal_ids
}
}

mutation{
addFood(food_id:"3", food_name:"rice", addAnimals:[2,5]){
food_id
animal_ids
countFilteredAnimals(search: {field:category, value:"Dog", operator: eq})
animalsFilter(pagination:{offset: 0, limit: 10}){
animal_name
}
animalsConnection(search: {field:category, value:"Dog", operator: eq},
pagination: {first:10})
{
edges{
node{
animal_id
}
}
}
}
}


{
readOneAnimal(animal_id: "2"){
animal_name
food_ids
countFilteredFood(search: {field:food_name, value:"pork", operator: eq})
foodFilter(search:{field:food_name, value:"pork", operator: eq},
pagination:{offset: 0, limit: 10}){
food_name
}
foodConnection(pagination:{first: 10}){
edges{
node{
food_name
}
}
}
}
}


/////////////////////////////one to one
mutation{
updateTracker(tracker_id:1, location:"garden", addUnique_animal:3){
tracker_id
animal_id
}
}
{
animals(search: {field: animal_id, operator: eq, value: "3"}, pagination: {limit: 10}) {
animal_id
unique_tracker {
tracker_id
}
}
}

introduce conflict
mutation{
addTracker(tracker_id:2, location:"living room", addUnique_animal:3){
tracker_id
animal_id
}
}

mutation{
updateTracker(tracker_id:1,removeUnique_animal:3){
tracker_id
animal_id
}
}
2 changes: 0 additions & 2 deletions utils/mongodb_helper.js
Original file line number Diff line number Diff line change
@@ -21,8 +21,6 @@ module.exports.orderConditionsToMongoDb = function(order, idAttribute, isForward
if (!Object.keys(sort).includes(idAttribute)) {
sort[idAttribute] = isForwardPagination ? 1 : -1
}
console.log("orderConditionsToMongoDb")
console.log(sort)
return sort;
}