Stringify dynamic query with embedded fields and $or

So i’m trying to pass dynamic query to mongodb, which required that embeded documents are passed in as strings. How do I pass on skills.skill such that it’s evaluated as a string and yet contains the next part of arguments.
The query is that collection.find({‘skills.skill’: {$and: [{$or: [{level: 1}]}, {$or: [{level: not 2}]}]}}).

 for (var a in combined) { //combined filters
  z[a] = {$and: [{$or: []}]}
  //state for what operation; if just equals or not equals
  //make sure that there's no empty $or statement for it-as if both
  var q = true
  for (var b in combined[a].levels) {
    if(combined[a].levels[b] == true) {
      if (!q || z[a].$or.length == 1) {
        q = false
        z[a].$or[0].push({$and: [combined[a].levels[b]: {$eq: b}]})
      } else {
        if (z[a].$or.length()==1) z[a].$or.push({$and: []})
        z[a].$or[1].$and.push({$and: [combined[a].levels[b]: {$eq: b}]})
    } else {
      if (z[a].$or.length == 2 || q) {
        z[a].$or[0].push({$or: [combined[a].levels[b]: {$ne: b}]})
      } else {
        if (z[a].$or.length()==1) z[a].$or.push({$and: []})
        z[a].$or[1].push({$or: [combined[a].levels[b]: {$ne: b}]})

I think I’d help if you sent some samples of the collection and the result you’re expecting. It wasn’t very clear what you need.

embeded query is “sdf.sdf.sdf”: 3, how do you attach or or and statement to
it to pass along.

I’ve solved similar task with dot-object NPM package.

See this great example from official docs.

Can you post it instead? What concerns me is the fact that I’m suppose to pass a string and then objects after it.