Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
migration to new db config
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Feb 6, 2020
1 parent a73a359 commit de4c436
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/main/java/com/andromeda/araserver/localSearchData/ReadDB.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
package com.andromeda.araserver.localSearchData

import com.microsoft.azure.documentdb.*
import org.json.JSONObject

class ReadDB {
fun main(client: DocumentClient): ArrayList<SkillsFromDB> {
val skillsFromDB = ArrayList<SkillsFromDB>()
val options = FeedOptions()
options.partitionKey = PartitionKey("readonly")
val queryResults: FeedResponse<Document> = client.queryDocuments("/dbs/Ara-android-database/colls/Ara-android-collection", "SELECT * FROM c ", options)
for (i in queryResults.queryIterator){
val json = i.get("document") as JSONObject
val model = SkillsFromDB(
pre = json.getString("pre"),
end = "",
action= json.getString("action")
)
skillsFromDB.add(model)
}
return skillsFromDB
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.andromeda.ara.util
package com.andromeda.araserver.localSearchData

data class SkillsFromDB(val pre:String, val end:String, val action:String) {
}

0 comments on commit de4c436

Please sign in to comment.