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

problems importing to mongo from a query #44

Open
billieblaze opened this issue Feb 5, 2014 · 0 comments
Open

problems importing to mongo from a query #44

billieblaze opened this issue Feb 5, 2014 · 0 comments

Comments

@billieblaze
Copy link

so, i've recently switched from the railo mongodb extension to cfmongodb because i'm having problems with my data landing in a proper mongodb format. I'm working on a routine which will perform a CFQUERY against a VisualFoxPro ODBC connection(barf), then stash the records in mongodb. the mongodb data will later be consumed by a nodeJS app. two problems i'm having

  1. i was setting _id to a particular field in my db, for example, the old db has a "drivernumber" field, so i was feeding that into _id because on the nodeJS side, i'm using mongoose ODM to handle "joining" the data when needed. This field is essentially a string. it works in both the mongodb extension for railo and mongodb itself, but throws an error "invalid objectID".. Is that something i can work around with some modification?

  2. this is the big one for me. I'm taking the cfquery results, iterating, converting to a struct (queryRowToStruct) and then stashing that in mongodb. I'm still getting string for everything. I've tried various javaCast and createObject(...javaDate..).init(mydate).. but its still landing as a string! further investigation indicates similar behavior is happening to ints as well.. Is it the fact that i'm converting to a struct? Also, can i feed a full query into some method in your wrapper?

any help would be great! i'm on the vere of just using epoch time, but i don't think that'll work quite right given the fact that it'd still be a string, mongo might not order it correctly..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant