* Populates the CurrentOp options based on the command spec. */
| 303 | * Populates the CurrentOp options based on the command spec. |
| 304 | */ |
| 305 | static void |
| 306 | PopulateCurrentOpOptions(pgbson *spec, CurrentOpOptions *options) |
| 307 | { |
| 308 | bson_iter_t currentOpIter; |
| 309 | PgbsonInitIterator(spec, ¤tOpIter); |
| 310 | while (bson_iter_next(¤tOpIter)) |
| 311 | { |
| 312 | const char *path = bson_iter_key(¤tOpIter); |
| 313 | const bson_value_t *value = bson_iter_value(¤tOpIter); |
| 314 | EnsureTopLevelFieldIsBooleanLike(path, ¤tOpIter); |
| 315 | |
| 316 | bool valueBool = BsonValueAsBool(value); |
| 317 | if (strcmp(path, "allUsers") == 0) |
| 318 | { |
| 319 | options->allUsers = valueBool; |
| 320 | } |
| 321 | else if (strcmp(path, "idleConnections") == 0) |
| 322 | { |
| 323 | options->idleConnections = valueBool; |
| 324 | } |
| 325 | else if (strcmp(path, "idleCursors") == 0) |
| 326 | { |
| 327 | options->idleCursors = valueBool; |
| 328 | } |
| 329 | else if (strcmp(path, "idleSessions") == 0) |
| 330 | { |
| 331 | options->idleSessions = valueBool; |
| 332 | } |
| 333 | else if (strcmp(path, "localOps") == 0) |
| 334 | { |
| 335 | options->localOps = valueBool; |
| 336 | } |
| 337 | else if (strcmp(path, "backtrace") == 0) |
| 338 | { |
| 339 | /* ignore*/ |
| 340 | } |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | |
| 345 | /* |
no test coverage detected